Registry / gcp / ga-api-client

ga-api-client

JSON →
library0.6.6pypypi✓ verified 30d ago

A Python client for the Google Analytics Data API v1 (beta). Version 0.6.6, released periodically.

gcphttp-networking
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)
Debug
Known footguns
breakingVersion 0.6.0 removed the `credentials` parameter; use `service_account_file` or `service_account_info` instead.
deprecatedThe `run_report` method's `dimension_filters` parameter is deprecated in favor of `dimension_filter` (singular).
gotchaProperty ID must be numeric (string of digits); passing a string with 'properties/' prefix or non-numeric values raises a misleading 404 error.
gotchaThe client does not automatically refresh expired OAuth tokens; long-running applications may encounter token expiration errors.
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.

Agent activity
11 hits · last 30 days
gptbot
3
ahrefsbot
3
claudebot
3
bingbot
1
bytedance
1
Resources