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

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.

If you were using one of the AdWords API client libraries, you can download one of the client libraries we provide for the Google Ads API and begin working straight away: please refer to your client library's README for instructions on how to setup 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

In case you are using the Java client library, you can simply 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 have 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.

.NET

  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.

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.

Skicka feedback om ...

Google Ads API Beta
Google Ads API Beta
Behöver du hjälp? Besök vår supportsida.