AdSense Management API
The AdSense Management API allows publishers to access their inventory and run earnings and performance reports.
E-commerce#openapi#analytics#media
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
The AdSense Management API allows publishers to access their inventory and run earnings and performance reports.
Endpoints 25
accounts.sites
- GETGets information about the selected site.
/v2/:nameGets information about the selected site. - GETLists all the sites available in an account.
/v2/:parent/sites?pageSize=0&pageToken=stringLists all the sites available in an account.
accounts.adclients.customchannels
- DELETEDeletes a custom channel
/v2/:nameDeletes a custom channel. This method can be called only by a restricted set of projects, which are usually owned by AdSense for Platforms publishers. Contact… - PATCHUpdates a custom channel
/v2/:name?updateMask=stringUpdates a custom channel. This method can be called only by a restricted set of projects, which are usually owned by AdSense for Platforms publishers. Contact… - GETLists all the custom channels available in an ad client.
/v2/:parent/customchannels?pageSize=0&pageToken=stringLists all the custom channels available in an ad client. - POSTCreates a custom channel
/v2/:parent/customchannelsCreates a custom channel. This method can be called only by a restricted set of projects, which are usually owned by AdSense for Platforms publishers. Contact… - GETLists all the ad units available for a custom channel.
/v2/:parent:listLinkedAdUnits?pageSize=0&pageToken=stringLists all the ad units available for a custom channel.
accounts
- GETGets the ad blocking recovery tag of an account.
/v2/:name/adBlockingRecoveryTagGets the ad blocking recovery tag of an account. - GETLists all accounts available to this user.
/v2/accounts?pageSize=0&pageToken=stringLists all accounts available to this user. - GETLists all accounts directly managed by the given AdSense account.
/v2/:parent:listChildAccounts?pageSize=0&pageToken=stringLists all accounts directly managed by the given AdSense account.
accounts.adclients.adunits
- GETGets the ad unit code for a given ad unit
/v2/:name/adcodeGets the ad unit code for a given ad unit. For more information, see About the AdSense code and Where to place the ad code in your HTML. - GETLists all ad units under a specified account and ad client.
/v2/:parent/adunits?pageSize=0&pageToken=stringLists all ad units under a specified account and ad client. - POSTCreates an ad unit
/v2/:parent/adunitsCreates an ad unit. This method can be called only by a restricted set of projects, which are usually owned by AdSense for Platforms publishers. Contact your… - GETLists all the custom channels available for an ad unit.
/v2/:parent:listLinkedCustomChannels?pageSize=0&pageToken=stringLists all the custom channels available for an ad unit.
accounts.adclients
- GETLists all the ad clients available in an account.
/v2/:parent/adclients?pageSize=0&pageToken=stringLists all the ad clients available in an account.
accounts.adclients.urlchannels
- GETLists active url channels.
/v2/:parent/urlchannels?pageSize=0&pageToken=stringLists active url channels.
accounts.alerts
- GETLists all the alerts available in an account.
/v2/:parent/alerts?languageCode=stringLists all the alerts available in an account.
accounts.payments
- GETLists all the payments available for an account.
/v2/:parent/paymentsLists all the payments available for an account.
accounts.policyIssues
- GETLists all the policy issues where the specified account is involved, both directly and through any AFP child accounts.
/v2/:parent/policyIssues?pageSize=0&pageToken=stringLists all the policy issues where the specified account is involved, both directly and through any AFP child accounts.
accounts.reports
- GETGenerates an ad hoc report.
/v2/:account/reports:generate?currencyCode=string&dateRange=REPORTING_DATE_RANGE_UNSPECIFIED&dimensions=DIMENSION_UNSPECIFIED&endDate.day=0&endDate.month=0&endDate.year=0&filters=string&languageCode=string&limit=0&metrics=METRIC_UNSPECIFIED&orderBy=string&reportingTimeZone=REPORTING_TIME_ZONE_UNSPECIFIED&startDate.day=0&startDate.month=0&startDate.year=0Generates an ad hoc report. - GETGenerates a csv formatted ad hoc report.
/v2/:account/reports:generateCsv?currencyCode=string&dateRange=REPORTING_DATE_RANGE_UNSPECIFIED&dimensions=DIMENSION_UNSPECIFIED&endDate.day=0&endDate.month=0&endDate.year=0&filters=string&languageCode=string&limit=0&metrics=METRIC_UNSPECIFIED&orderBy=string&reportingTimeZone=REPORTING_TIME_ZONE_UNSPECIFIED&startDate.day=0&startDate.month=0&startDate.year=0Generates a csv formatted ad hoc report. - GETGets the saved report from the given resource name.
/v2/:name/savedGets the saved report from the given resource name.
accounts.reports.saved
- GETGenerates a saved report.
/v2/:name/saved:generate?currencyCode=string&dateRange=REPORTING_DATE_RANGE_UNSPECIFIED&endDate.day=0&endDate.month=0&endDate.year=0&languageCode=string&reportingTimeZone=REPORTING_TIME_ZONE_UNSPECIFIED&startDate.day=0&startDate.month=0&startDate.year=0Generates a saved report. - GETGenerates a csv formatted saved report.
/v2/:name/saved:generateCsv?currencyCode=string&dateRange=REPORTING_DATE_RANGE_UNSPECIFIED&endDate.day=0&endDate.month=0&endDate.year=0&languageCode=string&reportingTimeZone=REPORTING_TIME_ZONE_UNSPECIFIED&startDate.day=0&startDate.month=0&startDate.year=0Generates a csv formatted saved report. - GETLists saved reports.
/v2/:parent/reports/saved?pageSize=0&pageToken=stringLists saved reports.
API details
- Base URL
https://adsense.googleapis.com- Authentication
- OAuth 2.0 (authorization code flow) with 2 scopes
An API key in the key query parameter - Operations
- 25 operations on 21 pathsGET 21POST 2PATCH 1DELETE 1
- Main resources
- accounts.adclients.customchannels 5accounts.adclients.adunits 4accounts 3accounts.reports 3accounts.reports.saved 3accounts.sites 2accounts.adclients 1accounts.adclients.urlchannels 1accounts.alerts 1accounts.payments 1
- Response formats
application/json- Description format
- Google API Discovery, API version
v2 - Links
- Documentation · OpenAPI document
- Listed from
- Google API Discovery document (googleapis/discovery-artifact-manager) (Apache-2.0)
How to test the AdSense Management API in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the AdSense Management API collection, without the publisher's secrets.
- Add your credentialsThis API uses OAuth 2.0 (authorization code flow) with 2 scopes. Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “Gets information about the selected site.” (GET /v2/:name), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the AdSense Management API?
The AdSense Management API allows publishers to access their inventory and run earnings and performance reports. It is listed under E-commerce and has 25 endpoints.
Who publishes the AdSense Management API?
It is listed from Google's public API description (an OpenAPI document), not published by Google on Swastik Codes. Anyone who controls googleapis.com can claim the profile by adding a DNS TXT record.
What is the base URL of the AdSense Management API?
Requests go to https://adsense.googleapis.com. Endpoint paths are added to this base URL.
How do I authenticate with the AdSense Management API?
It accepts 2 methods: OAuth 2.0 (authorization code flow) with 2 scopes; an API key in the key query parameter.
How many endpoints does the AdSense Management API have?
25 operations on 21 paths (21 GET, 2 POST, 1 PATCH, 1 DELETE). The largest groups are accounts.adclients.customchannels, accounts.adclients.adunits, accounts, accounts.reports.
Is forking the AdSense Management API free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.