Registry / gcp / ga-api-client

ga-api-client

JSON →
library0.6.6pypypi✓ verified 84d ago

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

pip install ga-api-client
INSTALL
IMPORT
SIG · GA-API-CLIENT
G
ga-api-client
gcppythonv0.6.6
harness data pending
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.

ga_api_client
✓ from ga_api import ga_api_client
✗ from ga_api_client import GAAPIClient

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 issues
breakingVersion 0.6.0 removed the `credentials` parameter; use `service_account_file` or `service_account_info` instead.
fix
Replace `client = GAAPIClient(credentials=...)` with `client = GAAPIClient(service_account_file='path/to/key.json')`.
affects: >=0.6.0
deprecatedThe `run_report` method's `dimension_filters` parameter is deprecated in favor of `dimension_filter` (singular).
fix
Use `dimension_filter` instead of `dimension_filters` in `run_report()`.
affects: <0.6.5
gotchaProperty ID must be numeric (string of digits); passing a string with 'properties/' prefix or non-numeric values raises a misleading 404 error.
fix
Ensure `property_id` is a plain numeric string like '123456789'.
affects: all
gotchaThe client does not automatically refresh expired OAuth tokens; long-running applications may encounter token expiration errors.
fix
Reinitialize the client or implement a token refresh mechanism using google-auth's `RefreshToken`.
affects: all
Upgrade
Version history
0.6.6latest on PyPI · released Nov 13, 2025
Audit
Dependencies
google-authrequiredAuthentication for Google APIs
google-api-python-clientrequiredUnderlying API client for Google APIs
google-analytics-datarequiredGoogle Analytics Data API v1 library
Agent activity
46 hits · last 30 days
node
40
OpenAI (training)
1
Resources
ga-api-client — pip install ga-api-client · libregistry