Python で Google Analytics Reporting APIを使う

Adsenseの売上を取得する

from apiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials

SCOPES = ["https://www.googleapis.com/auth/analytics.readonly"]
KEY_FILE_LOCATION = "xxxxxxxx.json"
VIEW_ID = "99
1