APIHub
Back to Explore

AdSense Host API

The AdSense Host API enables publishers to manage their hosted AdSense accounts and associated resources—such as ad clients, ad units, custom channels, and URL channels—through CRUD operations, retrieve ad code for specific units, and generate performance reports for selected accounts.

Analytics
OAuth
HTTPS
CORS: Unknown
Description enriched
Visit official documentation

Latency

7264ms p95

Uptime

100.0% 30d

Playground

Verified

live

Endpoints

REST · JSON
GET

/accounts

List hosted accounts associated with this AdSense account by ad client id.

  • filterAdClientId (query, required) — Ad clients to list accounts for.
GET

/accounts/{accountId}

Get information about the selected associated AdSense account.

  • accountId (path, required) — Account to get information about.
GET

/accounts/{accountId}/adclients

List all hosted ad clients in the specified hosted 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.
GET

/accounts/{accountId}/adclients/{adClientId}

Get information about one of the ad clients in the specified publisher's AdSense account.

  • accountId (path, required) — Account which contains the ad client.
  • adClientId (path, required) — Ad client to get.
GET

/accounts/{accountId}/adclients/{adClientId}/adunits

List all ad units in the specified publisher's AdSense account.

  • accountId (path, required) — Account which contains the ad client.
  • 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.
PATCH

/accounts/{accountId}/adclients/{adClientId}/adunits

Update the supplied ad unit in the specified publisher AdSense account. This method supports patch semantics.

  • accountId (path, required) — Account which contains the ad client.
  • adClientId (path, required) — Ad client which contains the ad unit.
  • adUnitId (query, required) — Ad unit to get.
POST

/accounts/{accountId}/adclients/{adClientId}/adunits

Insert the supplied ad unit into the specified publisher AdSense account.

  • accountId (path, required) — Account which will contain the ad unit.
  • adClientId (path, required) — Ad client into which to insert the ad unit.
PUT

/accounts/{accountId}/adclients/{adClientId}/adunits

Update the supplied ad unit in the specified publisher AdSense account.

  • accountId (path, required) — Account which contains the ad client.
  • adClientId (path, required) — Ad client which contains the ad unit.
DELETE

/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}

Delete the specified ad unit from the specified publisher AdSense account.

  • accountId (path, required) — Account which contains the ad unit.
  • adClientId (path, required) — Ad client for which to get ad unit.
  • adUnitId (path, required) — Ad unit to delete.
GET

/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}

Get the specified host ad unit in this AdSense account.

  • accountId (path, required) — Account which contains the ad unit.
  • adClientId (path, required) — Ad client for which to get ad unit.
  • adUnitId (path, required) — Ad unit to get.
GET

/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode

Get ad code for the specified ad unit, attaching the specified host custom channels.

  • accountId (path, required) — Account which contains the ad client.
  • adClientId (path, required) — Ad client with contains the ad unit.
  • adUnitId (path, required) — Ad unit to get the code for.
  • hostCustomChannelId (query) — Host custom channel to attach to the ad code.
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) — Hosted 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.
  • 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.
GET

/adclients

List all host 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}

Get information about one of the ad clients in the Host AdSense account.

  • adClientId (path, required) — Ad client to get.
GET

/adclients/{adClientId}/customchannels

List all host custom channels in 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.
PATCH

/adclients/{adClientId}/customchannels

Update a custom channel in the host AdSense account. This method supports patch semantics.

  • adClientId (path, required) — Ad client in which the custom channel will be updated.
  • customChannelId (query, required) — Custom channel to get.
POST

/adclients/{adClientId}/customchannels

Add a new custom channel to the host AdSense account.

  • adClientId (path, required) — Ad client to which the new custom channel will be added.
PUT

/adclients/{adClientId}/customchannels

Update a custom channel in the host AdSense account.

  • adClientId (path, required) — Ad client in which the custom channel will be updated.
DELETE

/adclients/{adClientId}/customchannels/{customChannelId}

Delete a specific custom channel from the host AdSense account.

  • adClientId (path, required) — Ad client from which to delete the custom channel.
  • customChannelId (path, required) — Custom channel to delete.
GET

/adclients/{adClientId}/customchannels/{customChannelId}

Get a specific custom channel from the host AdSense account.

  • adClientId (path, required) — Ad client from which to get the custom channel.
  • customChannelId (path, required) — Custom channel to get.
GET

/adclients/{adClientId}/urlchannels

List all host URL channels in the host 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.
POST

/adclients/{adClientId}/urlchannels

Add a new URL channel to the host AdSense account.

  • adClientId (path, required) — Ad client to which the new URL channel will be added.
DELETE

/adclients/{adClientId}/urlchannels/{urlChannelId}

Delete a URL channel from the host AdSense account.

  • adClientId (path, required) — Ad client from which to delete the URL channel.
  • urlChannelId (path, required) — URL channel to delete.
GET

/associationsessions/start

Create an association session for initiating an association with an AdSense user.

  • productCode (query, required) — Products to associate with the user.
  • websiteUrl (query, required) — The URL of the user's hosted website.
  • callbackUrl (query) — The URL to redirect the user to once association is completed. It receives a token parameter that can then be used to retrieve the associated account.
  • userLocale (query) — The preferred locale of the user.
  • websiteLocale (query) — The locale of the user's hosted website.
GET

/associationsessions/verify

Verify an association session after the association callback returns from AdSense signup.

  • token (query, required) — The token returned to the association callback URL.
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.
  • 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.

26 endpoints auto-detected

Authentication

This API requires authentication: OAuth.

curl -X GET \
  "https://www.googleapis.com/adsensehost/v4.1/accounts"

www.googleapis.com · HTTPS only