canonical: https://jentic.com/apis/googleapis.com/adsense

# Google AdSense Management API

The AdSense Management API lets web publishers programmatically read their AdSense inventory and earnings. It exposes operations to enumerate accounts, ad clients, ad units, custom channels, URL channels, sites, payments, alerts, and saved reports, and to generate ad-hoc earnings and performance reports against custom date ranges, dimensions, and metrics. Publishers and analytics teams use it to feed AdSense data into BI dashboards, monitor channel performance, and produce reconciliation reports without scraping the AdSense UI.

## For AI agents

Read AdSense accounts, ad clients, ad units, channels, payments, and alerts and generate earnings reports so an agent can monitor web ad revenue without using the AdSense UI.

## Scope

Does not handle ad creative review, ad unit code generation, or content-policy enforcement - use for reading AdSense account, inventory, payment, and report data only.

## Capabilities

- List AdSense accounts the calling Google account has access to and read account state
- Enumerate ad clients (AdSense for Content, AdSense for Search) and ad units under each account
- List custom and URL channels used to slice reporting by site section or content topic
- Generate earnings and performance reports across configurable dimensions and metrics, with CSV export
- Read payments history and current unpaid balance for an AdSense account
- List sites associated with an account and their auto-ads readiness
- Surface AdSense alerts (policy issues, payment holds) so they can be routed to ops channels

## Use cases

### Publisher Earnings Dashboard

A web publisher pipes AdSense earnings into a BI dashboard alongside affiliate and subscription revenue. The reports:generate endpoint accepts a date range, dimensions (such as DOMAIN and DATE) and metrics (estimated earnings, page views, RPM), returning rows that the pipeline writes to a warehouse. The reports:generateCsv variant streams large date ranges directly as CSV.

Example prompt: Generate a report for accounts/pub-1234 covering the last 30 days, grouped by DOMAIN and DATE, with ESTIMATED_EARNINGS and PAGE_VIEWS metrics, and write each row to BigQuery.

### Channel Performance Analysis

An ad-ops team reviews custom channel performance to decide which content topics deserve more inventory. The customchannels.list endpoint enumerates channels per ad client, and the reports:generate call with dimension=CUSTOM_CHANNEL_NAME returns per-channel earnings and click-through rate.

Example prompt: List custom channels under accounts/pub-1234/adclients/ca-pub-X, then generate a report grouped by CUSTOM_CHANNEL_NAME for last week and reply with the top 5 channels by RPM.

### Payment Reconciliation

A finance team reconciles AdSense payments against earnings statements every month. Payments.list and accounts.get return the current unpaid balance and historical payments, which the team compares to the same period's earnings report to spot delayed or split payments.

Example prompt: List payments under accounts/pub-1234 for the last 12 months, sum the amounts, compare to total ESTIMATED_EARNINGS in the same period, and emit any delta over 1%.

### AI Agent Revenue Q&A

An AI agent embedded in a publisher growth tool answers free-form questions like 'how much did Site A earn yesterday?' through Jentic. The agent picks the right reports:generate dimensions and metrics, executes the call, and replies with a one-paragraph answer.

Example prompt: Given the question 'how much did exampleblog.com earn yesterday', call reports:generate filtered to DOMAIN=exampleblog.com with metric ESTIMATED_EARNINGS for yesterday, and reply with the value in USD.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /v2/accounts | List AdSense accounts the caller can access |
| GET | /v2/{+name} | Get a single AdSense resource (account, ad client, ad unit, channel, site) |
| POST | /v2/{+account}/reports:generate | Generate an AdSense earnings or performance report as JSON |
| POST | /v2/{+account}/reports:generateCsv | Generate an AdSense report as CSV |
| GET | /v2/{+name}/adBlockingRecoveryTag | Get the ad-blocking-recovery tag for an account |

## Key resources

- **Accounts** — List AdSense accounts and read account-level state
- **Ad Clients and Ad Units** — Enumerate AdSense for Content and AdSense for Search ad clients and their ad units
- **Custom and URL Channels** — List custom channels and URL channels used to slice reporting
- **Reports** — Generate ad-hoc earnings and performance reports as JSON or CSV
- **Payments and Alerts** — Read payment history, unpaid balance, and account alerts
- **Sites** — List sites linked to an account and read auto-ads readiness

## Why Jentic

- **Setup:** Wiring the AdSense Management API by hand means setting up Google OAuth 2.0, minting short-lived access tokens from a refresh token, and pointing read and report calls at the adsense.googleapis.com host. Through Jentic you install once, import the AdSense Management API from the API Directory, store the OAuth credential once, and your agent calls it.
- **Permission scoping:** AdSense puts the account resource in the URL path (/v2/{+account}/reports:generate, /v2/{+name}), so a rule can pin your agent to one AdSense account: it can read that account's inventory and payments and nothing else. You choose the operations it may call, so report generation or CSV export is not included unless you add them.
- **Credential handling:** Your Google OAuth credential is stored once, encrypted, by your own Jentic One instance and exchanged for short-lived access tokens at execution time. The refresh token never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'generate an AdSense earnings report' or 'list AdSense accounts', and Jentic returns the matching AdSense operation with its input schema, so the dimension and metric fields are pre-typed and the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **AdMob API** — Reporting and inventory API for mobile app publishers
- **Google Search Console API** — Read search traffic and indexing data for the same domains
- **Google Analytics Data API** — Read GA4 user and session data for the same web properties

## FAQ

### What authentication does the AdSense Management API use?

It uses Google OAuth 2.0 with the https://www.googleapis.com/auth/adsense.readonly or adsense scope. The calling Google account must own or have delegated access to the target AdSense publisher account. Jentic stores the OAuth credential in its encrypted vault and exchanges it for short-lived access tokens at request time.

### Can I get yesterday's AdSense earnings through the API?

Yes. POST /v2/{account=accounts/*}/reports:generate with dateRange.startDate and endDate set to yesterday, dimensions=[DATE], and metrics=[ESTIMATED_EARNINGS] returns the previous day's earnings as soon as Google has finalised the day's data, typically within a few hours after midnight Pacific Time.

### What are the rate limits for the AdSense Management API?

The default quota is 10,000 queries per day per project, with bursts limited to a few queries per second. Report generation calls return paginated responses - clients must follow nextPageToken to retrieve full result sets, and CSV streaming requests should set Accept: text/csv to skip JSON parsing.

### How do I list ad clients on an account through Jentic?

Run jentic search 'list adsense ad clients', load the accounts.adclients.list operation, and execute it with parent set to accounts/{publisherId}. The agent receives a typed list of ad clients with name, productCode (AFC, AFS), and reportingDimensionId.

### Is the AdSense Management API free?

Yes. The API has no per-call fee and is available to anyone with an AdSense publisher account. Earnings reported by the API reflect the standard AdSense revenue share.

### Can I limit what my agent is allowed to do with the AdSense Management API?

Yes. Because you run Jentic One yourself, your own rules decide which AdSense operations and credentials the agent may use. Since AdSense puts the account in the URL path (/v2/{+account}/reports:generate and /v2/{+name}), you can pin the agent to a single AdSense account so it reads only that account's inventory, payments, and alerts. You also pick the exact operations it may call, so report generation and CSV export stay off unless you add reports:generate and reports:generateCsv.
