Skip to content

Instantly share code, notes, and snippets.

@glader
Created March 27, 2018 06:59
Show Gist options
  • Save glader/6b9327391caa27f8feddb082f09b0cc7 to your computer and use it in GitHub Desktop.
Save glader/6b9327391caa27f8feddb082f09b0cc7 to your computer and use it in GitHub Desktop.
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