v1.4 of the AdSense Management API is no longer available. Please migrate to v2 as soon as possible.

AdSense Management API

The AdSense Management API allows publishers to access their inventory and run earnings and performance reports.

Service: adsense.googleapis.com

To call this service, we recommend that you use the Google-provided client libraries. If your application needs to use your own libraries to call this service, use the following information when you make the API requests.

Discovery document

A Discovery Document is a machine-readable specification for describing and consuming REST APIs. It is used to build client libraries, IDE plugins, and other tools that interact with Google APIs. One service may provide multiple discovery documents. This service provides the following discovery documents:

Service endpoint

A service endpoint is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs below are relative to this service endpoint:

  • https://adsense.googleapis.com

REST Resource: v2.accounts

Methods
get GET /v2/{name=accounts/*}
Gets information about the selected AdSense account.
list GET /v2/accounts
Lists all accounts available to this user.
listChildAccounts GET /v2/{parent=accounts/*}:listChildAccounts
Lists all accounts directly managed by the given AdSense account.

REST Resource: v2.accounts.adclients

Methods
getAdcode GET /v2/{name=accounts/*/adclients/*}/adcode
Gets the AdSense code for a given ad client.
list GET /v2/{parent=accounts/*}/adclients
Lists all the ad clients available in an account.

REST Resource: v2.accounts.adclients.adunits

Methods
get GET /v2/{name=accounts/*/adclients/*/adunits/*}
Gets an ad unit from a specified account and ad client.
getAdcode GET /v2/{name=accounts/*/adclients/*/adunits/*}/adcode
Gets the AdSense code for a given ad unit.
list GET /v2/{parent=accounts/*/adclients/*}/adunits
Lists all ad units under a specified account and ad client.
listLinkedCustomChannels GET /v2/{parent=accounts/*/adclients/*/adunits/*}:listLinkedCustomChannels
Lists all the custom channels available for an ad unit.

REST Resource: v2.accounts.adclients.customchannels

Methods
get GET /v2/{name=accounts/*/adclients/*/customchannels/*}
Gets information about the selected custom channel.
list GET /v2/{parent=accounts/*/adclients/*}/customchannels
Lists all the custom channels available in an ad client.
listLinkedAdUnits GET /v2/{parent=accounts/*/adclients/*/customchannels/*}:listLinkedAdUnits
Lists all the ad units available for a custom channel.

REST Resource: v2.accounts.adclients.urlchannels

Methods
list GET /v2/{parent=accounts/*/adclients/*}/urlchannels
Lists active url channels.

REST Resource: v2.accounts.alerts

Methods
list GET /v2/{parent=accounts/*}/alerts
Lists all the alerts available in an account.

REST Resource: v2.accounts.payments

Methods
list GET /v2/{parent=accounts/*}/payments
Lists all the payments available for an account.

REST Resource: v2.accounts.reports

Methods
generate GET /v2/{account=accounts/*}/reports:generate
Generates an ad hoc report.
generateCsv GET /v2/{account=accounts/*}/reports:generateCsv
Generates a csv formatted ad hoc report.

REST Resource: v2.accounts.reports.saved

Methods
generate GET /v2/{name=accounts/*/reports/*}/saved:generate
Generates a saved report.
generateCsv GET /v2/{name=accounts/*/reports/*}/saved:generateCsv
Generates a csv formatted saved report.
list GET /v2/{parent=accounts/*}/reports/saved
Lists saved reports.

REST Resource: v2.accounts.sites

Methods
get GET /v2/{name=accounts/*/sites/*}
Gets information about the selected site.
list GET /v2/{parent=accounts/*}/sites
Lists all the sites available in an account.

Service: adsense.googleapis.com

To call this service, we recommend that you use the Google-provided client libraries. If your application needs to use your own libraries to call this service, use the following information when you make the API requests.

Discovery document

A Discovery Document is a machine-readable specification for describing and consuming REST APIs. It is used to build client libraries, IDE plugins, and other tools that interact with Google APIs. One service may provide multiple discovery documents. This service provides the following discovery documents:

Service endpoint

A service endpoint is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs below are relative to this service endpoint:

  • https://adsense.googleapis.com

REST Resource: v1.4.accounts

Methods
get GET /adsense/v1.4/accounts/{accountId}
Get information about the selected AdSense account.
list GET /adsense/v1.4/accounts
List all accounts available to this AdSense account.

REST Resource: v1.4.accounts.adclients

Methods
getAdCode GET /adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adcode
Get Auto ad code for a given ad client.
list GET /adsense/v1.4/accounts/{accountId}/adclients
List all ad clients in the specified account.

REST Resource: v1.4.accounts.adunits

Methods
get GET /adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}
Gets the specified ad unit in the specified ad client for the specified account.
getAdCode GET /adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode
Get ad code for the specified ad unit.
list GET /adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits
List all ad units in the specified ad client for the specified account.

REST Resource: v1.4.accounts.adunits.customchannels

Methods
list GET /adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels
List all custom channels which the specified ad unit belongs to.

REST Resource: v1.4.accounts.alerts

Methods
delete DELETE /adsense/v1.4/accounts/{accountId}/alerts/{alertId}
Dismiss (delete) the specified alert from the specified publisher AdSense account.
list GET /adsense/v1.4/accounts/{accountId}/alerts
List the alerts for the specified AdSense account.

REST Resource: v1.4.accounts.customchannels

Methods
get GET /adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}
Get the specified custom channel from the specified ad client for the specified account.
list GET /adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/customchannels
List all custom channels in the specified ad client for the specified account.

REST Resource: v1.4.accounts.customchannels.adunits

Methods
list GET /adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits
List all ad units in the specified custom channel.

REST Resource: v1.4.accounts.payments

Methods
list GET /adsense/v1.4/accounts/{accountId}/payments
List the payments for the specified AdSense account.

REST Resource: v1.4.accounts.reports

Methods
generate GET /adsense/v1.4/accounts/{accountId}/reports
Generate an AdSense report based on the report request sent in the query parameters.

REST Resource: v1.4.accounts.reports.saved

Methods
generate GET /adsense/v1.4/accounts/{accountId}/reports/{savedReportId}
Generate an AdSense report based on the saved report ID sent in the query parameters.
list GET /adsense/v1.4/accounts/{accountId}/reports/saved
List all saved reports in the specified AdSense account.

REST Resource: v1.4.accounts.savedadstyles

Methods
get GET /adsense/v1.4/accounts/{accountId}/savedadstyles/{savedAdStyleId}
List a specific saved ad style for the specified account.
list GET /adsense/v1.4/accounts/{accountId}/savedadstyles
List all saved ad styles in the specified account.

REST Resource: v1.4.accounts.urlchannels

Methods
list GET /adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/urlchannels
List all URL channels in the specified ad client for the specified account.

REST Resource: v1.4.adclients

Methods
list GET /adsense/v1.4/adclients
List all ad clients in this AdSense account.

REST Resource: v1.4.adunits

Methods
get GET /adsense/v1.4/adclients/{adClientId}/adunits/{adUnitId}
Gets the specified ad unit in the specified ad client.
getAdCode GET /adsense/v1.4/adclients/{adClientId}/adunits/{adUnitId}/adcode
Get ad code for the specified ad unit.
list GET /adsense/v1.4/adclients/{adClientId}/adunits
List all ad units in the specified ad client for this AdSense account.

REST Resource: v1.4.adunits.customchannels

Methods
list GET /adsense/v1.4/adclients/{adClientId}/adunits/{adUnitId}/customchannels
List all custom channels which the specified ad unit belongs to.

REST Resource: v1.4.alerts

Methods
delete DELETE /adsense/v1.4/alerts/{alertId}
Dismiss (delete) the specified alert from the publisher's AdSense account.
list GET /adsense/v1.4/alerts
List the alerts for this AdSense account.

REST Resource: v1.4.customchannels

Methods
get GET /adsense/v1.4/adclients/{adClientId}/customchannels/{customChannelId}
Get the specified custom channel from the specified ad client.
list GET /adsense/v1.4/adclients/{adClientId}/customchannels
List all custom channels in the specified ad client for this AdSense account.

REST Resource: v1.4.customchannels.adunits

Methods
list GET /adsense/v1.4/adclients/{adClientId}/customchannels/{customChannelId}/adunits
List all ad units in the specified custom channel.

REST Resource: v1.4.metadata.dimensions

Methods
list GET /adsense/v1.4/metadata/dimensions
List the metadata for the dimensions available to this AdSense account.

REST Resource: v1.4.metadata.metrics

Methods
list GET /adsense/v1.4/metadata/metrics
List the metadata for the metrics available to this AdSense account.

REST Resource: v1.4.payments

Methods
list GET /adsense/v1.4/payments
List the payments for this AdSense account.

REST Resource: v1.4.reports

Methods
generate GET /adsense/v1.4/reports
Generate an AdSense report based on the report request sent in the query parameters.

REST Resource: v1.4.reports.saved

Methods
generate GET /adsense/v1.4/reports/{savedReportId}
Generate an AdSense report based on the saved report ID sent in the query parameters.
list GET /adsense/v1.4/reports/saved
List all saved reports in this AdSense account.

REST Resource: v1.4.savedadstyles

Methods
get GET /adsense/v1.4/savedadstyles/{savedAdStyleId}
Get a specific saved ad style from the user's account.
list GET /adsense/v1.4/savedadstyles
List all saved ad styles in the user's account.

REST Resource: v1.4.urlchannels

Methods
list GET /adsense/v1.4/adclients/{adClientId}/urlchannels
List all URL channels in the specified ad client for this AdSense account.