Library / SDK
googleads/googleads-python-lib avatar
googleads/googleads-python-lib

googleads-python-lib, the Python client for the Google Ad Manager SOAP API

The Python client library for Google's Ads APIs

752 stars967 forksPythonApache-2.0

At a glance

What is it?
googleads/googleads-python-lib wraps the Google Ad Manager SOAP API in a Python client that handles OAuth2 credentials, generates service clients from the WSDL and ships a lot of example code. The release numbering tracks the API version, and a recent major release moved the library to the newer google-ads Python client.
Who is it for?
Adopt googleads-python-lib if you are integrating with the Google Ad Manager SOAP API in Python and want the generated service stubs and the OAuth2 plumbing handled for you. Skip it if you are using the Google Ads API rather than Ad Manager, since the newer client library covers that surface.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 59 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What the library actually covers

The README describes this as the client library for the Google Ad Manager SOAP API, and the name of the repository covers the broader Google Ads APIs. The Ad Manager API is the publisher side, with inventory, ad slots, line items, orders, creatives and reporting, and it is a SOAP API, which is the detail that shapes everything about the library.

The stated purpose is to simplify access to the API. The library provides easy ways to store your authentication and create SOAP web service clients, and it contains example code to help you get started integrating with the APIs.

That example code is a significant part of the value, and the README is explicit about where to find it. Code examples for the latest versions of Ad Manager are on the releases page, and the examples directory of the repository holds the Ad Manager samples. For an API with this many service objects, examples are worth more than the reference documentation, because the reference tells you what a field is called while an example tells you which fields you need together.

The release history is the version number tracking the API rather than the library. 49.0.0 in February 2026, 50.0.0 in May and 51.0.0 in August, with the last push on the same date as the 51.0.0 release. So the version moves when the API moves, which is the convention to expect from a generated client: the library is a projection of a service description, not an independently designed API.

The licence is Apache-2.0, the language is Python, and the default branch is main.

Installation, configuration file and the two OAuth flows

Installation is a pip install:

bash
pip install googleads

The README notes that setuptools is a prerequisite, and that it is recommended to install the library and its dependencies from PyPI using pip. The alternative is to download the library as a tarball and run the setup.py script from the unzipped directory:

bash
python setup.py build install

The second step of the setup is the one that is easy to miss. You copy the googleads.yaml file to your home directory, and it is used to store credentials and other settings that can be loaded to initialize a client. The library's LoadFromStorage methods default to looking for a file with that name in your home directory, and you can pass a path to any file with the correct YAML contents instead:

python
# Use the default location - your home directory:
ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()

# Alternatively, pass in the location of the file:
ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage('C:\My\Directory\googleads.yaml')

Caching the authentication information in a file rather than in code is the right arrangement, since it keeps the service account key out of your source and makes the same code work against a sandbox and a production account.

The third step is the OAuth2 setup, and the README splits it by use case. If you are accessing an API using your own credentials, the server-to-server flow applies. If you are accessing an API on behalf of clients, the web flow applies. That distinction is the one to get right, because the web flow involves a user consenting and a refresh token, while the service account flow does not, and mixing them up produces a client that works locally and fails in a scheduled job.

The library also supports caching the authentication information, with a sample file showing how, and the note that you fill in the fields for the API and features you plan to use. That is a useful hint, because the YAML file can carry more than credentials: settings for a specific API surface can live there too, so your client does not need to be reconfigured per call.

Logging, and the deliberate removal of sensitive data

The library uses Python's built-in logging framework, and you can configure it through the configuration file or manually.

The manual form, for logging SOAP interactions to stdout with the Zeep SOAP library, is:

python
logging.basicConfig(level=logging.INFO, format=googleads.util.LOGGER_FORMAT)
logging.getLogger('googleads.soap').setLevel(logging.DEBUG)

To log to a file you attach a log handler to that source, configured to write the output where you want it.

What matters more is the next section, which explains how to disable log filters. The Zeep plugin used for logging strips sensitive data from its output, and if you want that data included you have to implement your own simple logging plugin, with a class deriving from zeep.Plugin and an ingress method that receives the envelope, the HTTP headers and the operation.

That is a security-relevant detail rather than a technical inconvenience. The log filter exists because SOAP request bodies for the Ad Manager API contain credentials, targetings and other data that should not end up in a log file. Turning the filter off is a deliberate act, and if you do it you need to know that the logs now contain service account keys and OAuth tokens.

The best practice, which the README does not spell out but which follows from the design, is to keep the filter on and configure logging at INFO for the general case, raising to DEBUG only for the specific service and operation you are debugging and with the knowledge that the output is sensitive. Anyone who turns the filter off in a production environment has turned off a protection against writing credentials to disk.

The logger format constant, googleads.util.LOGGER_FORMAT, is provided so that the format string does not have to be invented, which is a small convenience that also keeps log lines parseable across services.

Where bug reports go, and how this fits with the newer client

The reporting split is worth reading because it saves a report going to the wrong place. If you have issues directly related to the client library, the README directs you to the issue tracker on the repository. If you have issues pertaining to a specific API, it directs you to the product support forums, and for Ad Manager that is the Google DoubleClick for Publishers API group on Google Groups.

The distinction is between a bug in the client and a bug in the service, and the second is much more common when you are starting out, because the API's behaviour around permissions and network configurations is not always obvious from the error message.

The wider context is that this library belongs to a family of Google Ads client libraries, one per language, and the Python one here. The version scheme of 51.0.0 and the generation-from-service-description approach are shared across them, which means the documentation and the examples in the other languages are directly comparable.

The important caveat for anyone choosing a library today is that the newer google-ads Python client library is the one that covers the Google Ads API, using the gRPC-based Google Ads API rather than the SOAP one. The naming here is confusing because the repository is called googleads-python-lib and the README's title is about the Ad Manager SOAP API, but the two cover different surfaces with different protocol styles.

So the decision is: if your target is Ad Manager, this library is the direct route. If your target is Google Ads campaigns, you want the newer client instead, and using this one would mean working against a SOAP API where the modern path is gRPC.

One more practical point on the examples. The README says code examples for the latest versions of Ad Manager are on the releases page, and the examples directory holds the samples in the repository. Since the library tracks the API version, an example copied from an old release may reference fields that no longer exist, which is why the README points at the releases page for the current ones rather than at a single directory.

Editorial conclusion

Adopt googleads-python-lib if you are integrating with the Google Ad Manager SOAP API in Python and want the generated service stubs and the OAuth2 plumbing handled for you. Skip it if you are using the Google Ads API rather than Ad Manager, since the newer client library covers that surface. Verify first by copying the googleads.yaml configuration into your home directory, filling in your credentials, and confirming LoadFromStorage returns a client before you build anything on top of it.

Frequently asked questions

What API does googleads-python-lib cover?

The README describes it as the client library for the Google Ad Manager SOAP API, providing ways to store authentication and create SOAP web service clients, together with example code for integrating with the APIs. The repository covers the wider Google Ads client libraries.

How do I install and configure the Google Ads Python client?

Run pip install googleads, then copy the googleads.yaml file from the repository to your home directory and fill in your credentials and the API settings you need. The LoadFromStorage methods look for that file in your home directory by default, and accept a path to any file with the right contents.

Which OAuth2 flow should I use?

The README splits the guidance by case. Accessing the API with your own credentials uses the server-to-server flow, while accessing it on behalf of clients uses the web flow, which involves a user consenting and a refresh token. The wiki links cover both.

How do I log SOAP interactions, and what gets filtered out?

The library uses Python's built-in logging, configurable through the config file or manually with basicConfig and a logger level for googleads.soap. The Zeep plugin used for logging strips sensitive data from its output, and the README explains how to implement your own plugin to include it.

Where should I report a problem?

Issues directly related to the client library go to the repository issue tracker, while issues pertaining to a specific API go to the product support forums, which for Ad Manager is the Google DoubleClick for Publishers API group.

Official sources

  1. googleads/googleads-python-lib on GitHub
  2. Issues
  3. License: Apache-2.0
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/googleads-googleads-python-lib.svg)](https://hysenlabs.com/projects/googleads-googleads-python-lib)

Was this useful?