Google Ads API is returning to beta status. Please read our blog post for more details.

OAuth Service Account Flow

This guide will walk you through how to setup OAuth2 for API access using your own credentials using server-to-server flow. These steps only need to be done once, unless you revoke or delete your OAuth2 credentials.

Step 1 - Creating OAuth2 credentials

Generate a service account ID and a *.JSON file by following the linked instructions, then come back to this page.

Step 2 - Setting up the client library using JSON configuration file

Configure the following keys in your google-ads.yaml config file, or in your environment.

In YAML:

path_to_private_key_file: INSERT_PRIVATE_KEY_FILE_PATH
delegate_account: INSERT_DELEGATE_ACCOUNT

In environment:

GOOGLE_ADS_PATH_TO_PRIVATE_KEY_FILE=INSERT_PRIVATE_KEY_FILE_PATH
GOOGLE_ADS_DELEGATE_ACCOUNT=INSERT_DELEGATE_ACCOUNT

Send feedback about...

Google Ads API Beta
Google Ads API Beta
Need help? Visit our support page.