AdSense Management API v1.4 Samples
A collection of command-line samples for the AdSense Management API.
##Installation and first request
- Download Google APIs Client Library for Python (google-api-python-client): https://code.google.com/p/google-api-python-client/
or use pip:
$ pip install google-api-python-client
- Make sure you can import the client library:
$ python >>> import apiclient
- Execute any of the scripts to begin the auth flow:
$ python get_all_accounts.py
A browser window will open and ask you to login. Use the AdSense account.
- Accept the permissions dialog. The browser should display
The authentication flow has completed.
Close the window and go back to the shell.
- The script will output:
Account with ID "pub-1234567890123456" and name "My account" was found.
- The tokens will be stored in adsense.dat.
Remove this file to restart the auth flow.