Created
March 27, 2018 06:59
-
-
Save glader/6b9327391caa27f8feddb082f09b0cc7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
token = 'ya29.Gl1...' | |
res = requests.get('https://www.googleapis.com/adsense/v1.4/reports', | |
params={ | |
'startDate': '2018-02-01', | |
'endDate': '2018-02-28', | |
'currency': 'RUB', | |
'dimension': ['DOMAIN_NAME','MONTH'], | |
'metric': 'EARNINGS', | |
}, | |
headers={ | |
'Authorization': 'OAuth %s' % token | |
} | |
) | |
for row in res.json()['rows']: | |
print '\t'.join(row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment