The AdSense Management API provides programmatic access to a publisher’s AdSense account, allowing retrieval of account details, ad clients, ad units, custom and URL channels, alerts and payments, and enabling generation of performance reports with customizable dimensions, metrics, filters and date ranges.
Dismiss (delete) the specified alert from the publisher's AdSense account.
alertId(path, required) — Alert to delete.
GET
/metadata/dimensions
List the metadata for the dimensions available to this AdSense account.
GET
/metadata/metrics
List the metadata for the metrics available to this AdSense account.
GET
/payments
List the payments for this AdSense account.
GET
/accounts
List all accounts available to this AdSense account.
maxResults(query, limit) — The maximum number of accounts to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
GET
/accounts/{accountId}
Get information about the selected AdSense account.
accountId(path, required) — Account to get information about.
tree(query) — Whether the tree of sub accounts should be returned.
GET
/accounts/{accountId}/adclients
List all ad clients in the specified account.
accountId(path, required) — Account for which to list ad clients.
maxResults(query, limit) — The maximum number of ad clients to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
List all ad units in the specified ad client for the specified account.
accountId(path, required) — Account to which the ad client belongs.
adClientId(path, required) — Ad client for which to list ad units.
includeInactive(query) — Whether to include inactive ad units. Default: true.
maxResults(query, limit) — The maximum number of ad units to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
List all custom channels which the specified ad unit belongs to.
accountId(path, required) — Account to which the ad client belongs.
adClientId(path, required) — Ad client which contains the ad unit.
adUnitId(path, required) — Ad unit for which to list custom channels.
maxResults(query, limit) — The maximum number of custom channels to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
List all custom channels in the specified ad client for the specified account.
accountId(path, required) — Account to which the ad client belongs.
adClientId(path, required) — Ad client for which to list custom channels.
maxResults(query, limit) — The maximum number of custom channels to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
List all ad units in the specified custom channel.
accountId(path, required) — Account to which the ad client belongs.
adClientId(path, required) — Ad client which contains the custom channel.
customChannelId(path, required) — Custom channel for which to list ad units.
includeInactive(query) — Whether to include inactive ad units. Default: true.
maxResults(query, limit) — The maximum number of ad units to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
List all URL channels in the specified ad client for the specified account.
accountId(path, required) — Account to which the ad client belongs.
adClientId(path, required) — Ad client for which to list URL channels.
maxResults(query, limit) — The maximum number of URL channels to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
GET
/accounts/{accountId}/alerts
List the alerts for the specified AdSense account.
accountId(path, required) — Account for which to retrieve the alerts.
locale(query) — The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.
DELETE
/accounts/{accountId}/alerts/{alertId}
Dismiss (delete) the specified alert from the specified publisher AdSense account.
accountId(path, required) — Account which contains the ad unit.
alertId(path, required) — Alert to delete.
GET
/accounts/{accountId}/payments
List the payments for the specified AdSense account.
accountId(path, required) — Account for which to retrieve the payments.
GET
/accounts/{accountId}/reports
Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
accountId(path, required) — Account upon which to report.
startDate(query, required) — Start of the date range to report on in "YYYY-MM-DD" format, inclusive.
endDate(query, required) — End of the date range to report on in "YYYY-MM-DD" format, inclusive.
currency(query) — Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.
dimension(query) — Dimensions to base the report on.
filter(query) — Filters to be run on the report.
locale(query) — Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified.
maxResults(query, limit) — The maximum number of rows of report data to return.
metric(query) — Numeric columns to include in the report.
sort(query) — The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending.
startIndex(query) — Index of the first row of report data to return.
useTimezoneReporting(query) — Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used.
GET
/accounts/{accountId}/reports/saved
List all saved reports in the specified AdSense account.
accountId(path, required) — Account to which the saved reports belong.
maxResults(query, limit) — The maximum number of saved reports to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
GET
/accounts/{accountId}/reports/{savedReportId}
Generate an AdSense report based on the saved report ID sent in the query parameters.
accountId(path, required) — Account to which the saved reports belong.
savedReportId(path, required) — The saved report to retrieve.
locale(query) — Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified.
maxResults(query, limit) — The maximum number of rows of report data to return.
startIndex(query) — Index of the first row of report data to return.
GET
/accounts/{accountId}/savedadstyles
List all saved ad styles in the specified account.
accountId(path, required) — Account for which to list saved ad styles.
maxResults(query, limit) — The maximum number of saved ad styles to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
List a specific saved ad style for the specified account.
accountId(path, required) — Account for which to get the saved ad style.
savedAdStyleId(path, required) — Saved ad style to retrieve.
GET
/adclients
List all ad clients in this AdSense account.
maxResults(query, limit) — The maximum number of ad clients to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
GET
/adclients/{adClientId}/adunits
List all ad units in the specified ad client for this AdSense account.
adClientId(path, required) — Ad client for which to list ad units.
includeInactive(query) — Whether to include inactive ad units. Default: true.
maxResults(query, limit) — The maximum number of ad units to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
GET
/adclients/{adClientId}/adunits/{adUnitId}
Gets the specified ad unit in the specified ad client.
adClientId(path, required) — Ad client for which to get the ad unit.
adUnitId(path, required) — Ad unit to retrieve.
GET
/adclients/{adClientId}/adunits/{adUnitId}/adcode
Get ad code for the specified ad unit.
adClientId(path, required) — Ad client with contains the ad unit.
adUnitId(path, required) — Ad unit to get the code for.
List all custom channels which the specified ad unit belongs to.
adClientId(path, required) — Ad client which contains the ad unit.
adUnitId(path, required) — Ad unit for which to list custom channels.
maxResults(query, limit) — The maximum number of custom channels to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
GET
/adclients/{adClientId}/customchannels
List all custom channels in the specified ad client for this AdSense account.
adClientId(path, required) — Ad client for which to list custom channels.
maxResults(query, limit) — The maximum number of custom channels to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
List all ad units in the specified custom channel.
adClientId(path, required) — Ad client which contains the custom channel.
customChannelId(path, required) — Custom channel for which to list ad units.
includeInactive(query) — Whether to include inactive ad units. Default: true.
maxResults(query, limit) — The maximum number of ad units to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
GET
/adclients/{adClientId}/urlchannels
List all URL channels in the specified ad client for this AdSense account.
adClientId(path, required) — Ad client for which to list URL channels.
maxResults(query, limit) — The maximum number of URL channels to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
GET
/alerts
List the alerts for this AdSense account.
locale(query) — The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.
GET
/reports
Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
startDate(query, required) — Start of the date range to report on in "YYYY-MM-DD" format, inclusive.
endDate(query, required) — End of the date range to report on in "YYYY-MM-DD" format, inclusive.
accountId(query) — Accounts upon which to report.
currency(query) — Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.
dimension(query) — Dimensions to base the report on.
filter(query) — Filters to be run on the report.
locale(query) — Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified.
maxResults(query, limit) — The maximum number of rows of report data to return.
metric(query) — Numeric columns to include in the report.
sort(query) — The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending.
startIndex(query) — Index of the first row of report data to return.
useTimezoneReporting(query) — Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used.
GET
/reports/saved
List all saved reports in this AdSense account.
maxResults(query, limit) — The maximum number of saved reports to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
GET
/reports/{savedReportId}
Generate an AdSense report based on the saved report ID sent in the query parameters.
savedReportId(path, required) — The saved report to retrieve.
locale(query) — Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified.
maxResults(query, limit) — The maximum number of rows of report data to return.
startIndex(query) — Index of the first row of report data to return.
GET
/savedadstyles
List all saved ad styles in the user's account.
maxResults(query, limit) — The maximum number of saved ad styles to include in the response, used for paging.
pageToken(query) — A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
GET
/savedadstyles/{savedAdStyleId}
Get a specific saved ad style from the user's account.
savedAdStyleId(path, required) — Saved ad style to retrieve.