A Python client for the Google Analytics Data API v1 (beta). Version 0.6.6, released periodically.
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
from ga_api import ga_api_client
Initialize client and run a simple active users report.
from ga_api_client import GAAPIClient
import os
client = GAAPIClient(
property_id='123456789',
service_account_file=os.environ.get('GA_SERVICE_ACCOUNT_FILE', 'service-account.json')
)
response = client.run_report(metrics=['activeUsers'], date_ranges=['7daysAgo'])
print(response)
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.