Get Last Month's Adsense Profits Via PHP : This question is asked in various forms (none to specific) on this site and I'd like to build a solution once and for all that attempts to conquer what are a LOT of confusing steps.

Loudly stated: I NEED TO EXTRACT MY TOTAL ADSENSE EARNINGS FROM LAST MONTH for use with my website.

1) I realize this will require the Adsense API

2) I realize I'll need to provide credentials

A lot of existing Q&A on the matter refers to previous versions of Google's AdSense interface. I want to do this based on (as of) 2017.

**THE QUESTION:
Will someone please provide an accurate, step-by-step and even over-explanatory instructional on how to do this complete with WHICH APIs are necessary and also their configuration?**

I've attempted to go through the motions MANY times over and all I ever get (when I'm lucky enough to make the server/server handshake happen) is an error suggesting "must login" within the JSON output.

I've read some info on "solutions" for this but can't quite tell if either they don't work or my enabled API is incorrect (or misconfigured).

In the end, it's a mess (in my opinion) by GUI standards.

Help me get this noise working "once and for all"? (yeah, right)