{"id":27776,"library":"ga-api-client","title":"GA API Client","description":"A Python client for the Google Analytics Data API v1 (beta). Version 0.6.6, released periodically.","status":"active","version":"0.6.6","language":"python","source_language":"en","source_url":"https://github.com/ngoc-vuong-dev/ga-api-client","tags":["google-analytics","analytics","api-client","google-data-api"],"install":[{"cmd":"pip install ga-api-client","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Authentication for Google APIs","package":"google-auth","optional":false},{"reason":"Underlying API client for Google APIs","package":"google-api-python-client","optional":false},{"reason":"Google Analytics Data API v1 library","package":"google-analytics-data","optional":false}],"imports":[{"note":"GAAPIClient is exported from the top-level __init__.py","wrong":"from ga_api_client.client import GAAPIClient","symbol":"GAAPIClient","correct":"from ga_api_client import GAAPIClient"}],"quickstart":{"code":"from ga_api_client import GAAPIClient\nimport os\n\nclient = GAAPIClient(\n    property_id='123456789',\n    service_account_file=os.environ.get('GA_SERVICE_ACCOUNT_FILE', 'service-account.json')\n)\nresponse = client.run_report(metrics=['activeUsers'], date_ranges=['7daysAgo'])\nprint(response)","lang":"python","description":"Initialize client and run a simple active users report."},"warnings":[{"fix":"Replace `client = GAAPIClient(credentials=...)` with `client = GAAPIClient(service_account_file='path/to/key.json')`.","message":"Version 0.6.0 removed the `credentials` parameter; use `service_account_file` or `service_account_info` instead.","severity":"breaking","affected_versions":">=0.6.0"},{"fix":"Use `dimension_filter` instead of `dimension_filters` in `run_report()`.","message":"The `run_report` method's `dimension_filters` parameter is deprecated in favor of `dimension_filter` (singular).","severity":"deprecated","affected_versions":"<0.6.5"},{"fix":"Ensure `property_id` is a plain numeric string like '123456789'.","message":"Property ID must be numeric (string of digits); passing a string with 'properties/' prefix or non-numeric values raises a misleading 404 error.","severity":"gotcha","affected_versions":"all"},{"fix":"Reinitialize the client or implement a token refresh mechanism using google-auth's `RefreshToken`.","message":"The client does not automatically refresh expired OAuth tokens; long-running applications may encounter token expiration errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use `from ga_api_client import GAAPIClient` (note: import from the package name with underscores, not hyphens).","cause":"Incorrect import path; `GAAPIClient` is not a direct attribute of the module if imported wrong.","error":"AttributeError: module 'ga_api_client' has no attribute 'GAAPIClient'"},{"fix":"Use `service_account_file` or `service_account_info` instead of `credentials`.","cause":"Breaking change in version 0.6.0 renamed the `credentials` parameter to `service_account_file`.","error":"TypeError: __init__() got an unexpected keyword argument 'credentials'"},{"fix":"Set property_id as a plain numeric string, e.g., '123456789'.","cause":"Common when property_id is malformed (e.g., 'properties/123456789' instead of '123456789').","error":"google.api_core.exceptions.NotFound: 404 Request is missing required authentication credential"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}