Migrating from the AdWords API to the Google Ads API

If you have already used the AdWords API, the credentials you were using will still be valid for the Google Ads API: you don't need to request a new developer token or to create new OAuth2 clientId and clientSecret pairs.

Using a client library

If you were using one of the AdWords API client libraries, you can download one of our Google Ads API client libraries and begin working straight away. Refer to the client library's README for instructions on how to set up the configuration file.

In most cases, your existing configuration can be reused when migrating from the AdWords API client libraries to Google Ads API client libraries.

Java configuration example

For the Java client library, you can just copy the lines in your ads.properties file that specify the credentials and change the api.adwords prefix in each key to api.googleads:

api.adwords.clientId       --> api.googleads.clientId
api.adwords.clientSecret   --> api.googleads.clientSecret
api.adwords.refreshToken   --> api.googleads.refreshToken
api.adwords.developerToken --> api.googleads.developerToken

Once you've updated the configuration file, you can proceed to make your first call:

Java

  1. In your IDE, open GetCampaigns.java and execute it.
  2. The console should print a listing of the campaigns in your account.

C#

  1. In your IDE, open GetCampaigns.cs and execute it.
  2. The console should print a listing of the campaigns in your account.

PHP

  1. Execute GetCampaigns.php.
  2. The console should print a listing of the campaigns in your account.

Python

  1. In your IDE, open get_campaigns.py and execute it.
  2. The console should print a listing of the campaigns in your account.

Ruby

  1. On the command line, execute get_campaigns.rb by typing:
    ruby get_campaigns.rb
  2. The console should print a listing of the campaigns in your account.

Perl

  1. Execute get_campaigns.pl.
  2. The console should print a listing of the campaigns in your account.

Code examples

The client libraries also provide step-by-step code examples showing how to migrate from the AdWords API to the Google Ads API.

Not using a client library

If you were using the AdWords API without a client library and want to keep doing so with the Google Ads API, you can still use your credentials.

Head to the call structure guide to see how to use them to perform requests against the Google Ads API using REST over HTTP.