google-ads-python

Official Python client library for the Google Ads API

SDK
PyPI
v31.3.0
740stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
77/100Good
Development Activity68
Maintenance68
Community84
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
65/100Good
Architecture75
Code Quality70
Innovation60
Learning Curve55

google-ads-python is Google’s officially maintained Python client for the Google Ads API, generated and hand-tuned around gRPC service stubs for every resource the API exposes — campaigns, ad groups, keywords, audiences, conversions, and reporting. It wraps authentication (OAuth2/service accounts via google-auth-oauthlib), request/response protobuf marshalling, and versioned service clients (multiple concurrent API versions like v22 through v24 ship in the same release) behind a single GoogleAdsClient entry point, so advertisers and agencies can automate account management and reporting without hand-rolling gRPC calls.

What You Get

  • A GoogleAdsClient that loads credentials from a google-ads.yaml config file or environment variables and exposes every versioned service (CampaignService, AdGroupService, GoogleAdsService, etc.)
  • Generated service, resource, enum, and error classes per API version (v22–v24 ship side by side, easing version-migration testing)
  • Built-in OAuth2 and service-account authentication handling via google-auth-oauthlib, so credential plumbing doesn’t need to be reimplemented
  • Interceptors for logging, retry, and metadata injection on every gRPC call
  • 134+ runnable example scripts covering campaign management, reporting (GAQL queries), remarketing, experiments, and audience insights

Common Use Cases

  • Automating bulk campaign, ad group, and keyword creation/updates for accounts too large to manage in the Ads UI
  • Pulling performance reports via GAQL (Google Ads Query Language) into a data warehouse or BI pipeline
  • Building agency tools that manage multiple linked Google Ads accounts (MCC) programmatically
  • Syncing conversion data or offline conversion adjustments from a CRM back into Google Ads

Under The Hood

Architecture: the library is organized under google/ads/googleads/, with a top-level GoogleAdsClient in the client module dispatching to per-version subpackages (v22, v23, v24, each split into services, resources, enums, common, errors, actions); an interceptors package wraps every outbound gRPC call for logging, metadata, and exception translation, keeping cross-cutting concerns out of the generated service code. Tech Stack: pure Python 3.9–3.14, built on grpcio/grpcio-status for transport, proto-plus and protobuf for message typing, googleapis-common-protos for shared API types, google-auth-oauthlib for credential flows, and PyYAML for the google-ads.yaml config format — pinned to narrow, python-version-conditional dependency ranges to track Google’s own API release cadence. Code Quality: 32 test files under tests/ covering interceptors, constraints, and the bundled examples, run via noxfile.py across supported Python versions; because most of the client and message code is generated from Google’s internal API definitions rather than hand-written, code quality tracks Google’s protobuf/gRPC codegen conventions rather than typical open-source style. API Design: the client centralizes configuration into one GoogleAdsClient.load_from_storage()/load_from_env() entry point and returns fully-typed service clients per resource, which is ergonomic once configured but carries real boilerplate — GAQL query strings, explicit resource-name construction, and per-version import paths are all required up front, and the 134 bundled examples exist specifically because the raw API surface is large and non-obvious to newcomers.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search