AdSense Management API: a primer

Thursday, October 27, 2011 | 5:57 AM

Labels:

Earlier this week, we launched the AdSense Management API, a new API open to all AdSense publishers. Today, we'd like to provide you with a few more details on what it can do and how you can use it.


Functionality

The main feature of the Management API, and the one we've had requests for most often, is the ability to run reports. The API provides the full set of AdSense reporting functionality available in the AdSense interface, with a wide array of dimensions and metrics, configurable sorting, and powerful filters. For more details, check the reports.generate method reference.

In addition to reporting, you can also list your inventory, namely your ad clients (the different AdSense products your account is subscribed to), ad units and channels (both URL and custom).

We'll be expanding AdSense Management API functionality in the future, so keep an eye on this blog.


Technology

The new API is based on Google's latest API technology, which means you'll get the same benefits that newer Google APIs provide. These include generic client libraries for major programming languages, OAuth and OAuth 2.0 authentication support, and the APIs explorer.

In addition, since this is a RESTful API based entirely on open standards, you should be able to use it in just about every development environment, as long as you can make HTTP requests!


Getting started

If you're a Java, Python or PHP developer, you should take a look at our guide for using the client libraries. The guide lists all you need to know if you're starting from scratch, guiding you from downloading the client library to obtaining a performance report. The sample code pages for these three languages will soon contain full samples for each API method.

If you want to use other client libraries or skip the client libraries altogether and use the API directly, the getting started guide explains the basics of the AdSense Management API, including the AdSense terminology being used, the URL structure and the calling style. The reference provides details for all of the available methods, their parameters and returns.


More to come

Over the coming weeks, we'll be writing some more in-depth blog posts exploring the AdSense Management API. We'll be focusing on the more complex topics of API usage, such as how to perform authentication, how to persist credential data, and the details in running reports.

In the meantime, feel free to use the forum!