Page Summary
-
The AdSense Management API allows publishers to manage their inventory and access earnings and performance reports.
-
The API provides various REST resources for accessing information about accounts, ad clients, ad units, custom channels, URL channels, alerts, payments, policy issues, reports, and sites.
-
You can use Google-provided client libraries or make direct API requests to call the adsense.googleapis.com service.
-
The service endpoint for the AdSense Management API is
https://adsense.googleapis.com.
The AdSense Management API allows publishers to access their inventory and run earnings and performance reports.
- REST Resource: v2.accounts
- REST Resource: v2.accounts.adclients
- REST Resource: v2.accounts.adclients.adunits
- REST Resource: v2.accounts.adclients.customchannels
- REST Resource: v2.accounts.adclients.urlchannels
- REST Resource: v2.accounts.alerts
- REST Resource: v2.accounts.payments
- REST Resource: v2.accounts.policyIssues
- REST Resource: v2.accounts.reports
- REST Resource: v2.accounts.reports.saved
- REST Resource: v2.accounts.sites
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 document:
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. |
getAdBlockingRecoveryTag
|
GET /v2/{name=accounts/*}/adBlockingRecoveryTag
Gets the ad blocking recovery tag of an 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 | |
|---|---|
get
|
GET /v2/{name=accounts/*/adclients/*}
Gets the ad client from the given resource name. |
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 | |
|---|---|
create
|
POST /v2/{parent=accounts/*/adclients/*}/adunits
Creates an ad unit. |
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 ad unit 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. |
patch
|
PATCH /v2/{adUnit.name=accounts/*/adclients/*/adunits/*}
Updates an ad unit. |
REST Resource: v2.accounts.adclients.customchannels
| Methods | |
|---|---|
create
|
POST /v2/{parent=accounts/*/adclients/*}/customchannels
Creates a custom channel. |
delete
|
DELETE /v2/{name=accounts/*/adclients/*/customchannels/*}
Deletes a custom channel. |
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. |
patch
|
PATCH /v2/{customChannel.name=accounts/*/adclients/*/customchannels/*}
Updates a custom channel. |
REST Resource: v2.accounts.adclients.urlchannels
| Methods | |
|---|---|
get
|
GET /v2/{name=accounts/*/adclients/*/urlchannels/*}
Gets information about the selected url channel. |
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.policyIssues
| Methods | |
|---|---|
get
|
GET /v2/{name=accounts/*/policyIssues/*}
Gets information about the selected policy issue. |
list
|
GET /v2/{parent=accounts/*}/policyIssues
Lists all the policy issues where the specified account is involved, both directly and through any AFP child accounts. |
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. |
getSaved
|
GET /v2/{name=accounts/*/reports/*}/saved
Gets the saved report from the given resource name. |
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. |

