# YouTube Revenue Report (`youtube.revenue_report`)

Runs a YouTube Analytics revenue report for your monetized channel: estimated revenue, ad revenue, CPM and ad impressions by day, month, video or country.

Docs: https://primaryapi.com/docs/api-reference/youtube/revenue_report

- Endpoint: `POST https://api.primaryapi.com/v1/run/youtube.revenue_report`
- Category: Web Intelligence · Platform: `youtube` · Kind: search · Status: live
- Price: 1 credit per call. Every call costs the same, including calls that were retried automatically.
- Billing unit: per successful call
- Reliability: routed to a healthy upstream and retried automatically when an attempt fails; live 30-day status: `GET https://api.primaryapi.com/v1/status/apis?sku=youtube.revenue_report`
- Execution: synchronous (answers 202 only if it outlives the wait window)

## Input

| Field | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
| `channelId` | string | no |  | pattern: ^[A-Za-z0-9_-]{1,64}$ | One of your channel ids (youtube.my_channels). Default: the channel of the connected account ("MINE"). |
| `startDate` | string | yes |  | pattern: ^\d{4}-\d{2}-\d{2}$ | First day of the report (YYYY-MM-DD), inclusive. |
| `endDate` | string | yes |  | pattern: ^\d{4}-\d{2}-\d{2}$ | Last day of the report (YYYY-MM-DD), inclusive; on or after startDate. |
| `metrics` | string[] | yes |  | min 1 items; max 20 items | Metrics (1-20), at least one of them a revenue or ad metric: estimatedRevenue, estimatedAdRevenue, estimatedRedPartnerRevenue, grossRevenue, cpm, adImpressions, monetizedPlaybacks, playbackBasedCpm. Views, watch time and the other activity metrics may be added. |
| `dimensions` | enum[] | no | [] | max 6 items | Group rows by these (up to 6), e.g. ["day"], ["video"], ["country"], ["ageGroup", "gender"]. Empty (default) = one total row. |
| `filters` | object[] | no |  | max 10 items | Filters that must all match, e.g. [{"dimension":"video","values":["dQw4w9WgXcQ"]}]. |
| `filters[].dimension` | enum | yes |  | one of: video, playlist, country, province, dma, city, day, month, insightPlaybackLocationType, insightPlaybackLocationDetail, creatorContentType, liveOrOnDemand, subscribedStatus, youtubeProduct, insightTrafficSourceType, insightTrafficSourceDetail, deviceType, operatingSystem, ageGroup, gender, sharingService, elapsedVideoTimeRatio, audienceType, livestreamPosition, membershipsCancellationSurveyReason, adType, reservedInstreamSelect, continent, subContinent, group, isCurated | Dimension to filter on, e.g. "video", "country", "continent", "insightTrafficSourceType". |
| `filters[].values` | string[] | yes |  | min 1 items; max 500 items; items pattern: ^[^=,;]{1,200}$ | Values to keep. Several values only for video and playlist (up to 500 ids). |
| `sort` | object[] | no |  | max 5 items | Sort order, e.g. [{"field":"views","descending":true}]. Top-video and detail reports require one. |
| `sort[].field` | string | yes |  | max 100 chars | A metric or dimension of this report. |
| `sort[].descending` | boolean | no | false |  | Descending order (default ascending). |
| `limit` | integer | no | 200 | 1–10000 | Maximum number of results to return (1-10000, default 200). |
| `cursor` | string | no |  |  | Opaque pagination cursor: pass the previous response's nextCursor. |
| `connection` | string | no |  | max 200 chars | Which connected account to use when the workspace has several for this provider: the customId you gave it (exact), its connection id ("con_…"), its handle (login, email or @handle) or its name. Optional; prefer the customId or id, which never match two accounts. |
| `currency` | enum | no | "USD" | one of: AED, ANG, ARS, AUD, BDT, BGN, BHD, BND, BOB, BRL, BWP, CAD, CHF, CLP, CNY, COP, CRC, CZK, DKK, DOP, DZD, EGP, EUR, FJD, GBP, GTQ, HKD, HNL, HRK, HUF, IDR, ILS, INR, JMD, JOD, JPY, KES, KRW, KWD, KYD, KZT, LBP, LKR, MAD, MDL, MKD, MUR, MVR, MXN, MYR, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, SAR, SCR, SEK, SGD, SLL, SVC, THB, TND, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VEF, VND, XAF, XOF, YER, ZAR | ISO 4217 currency of the revenue metrics (default USD). |

Unknown fields are rejected with `400 invalid_input`. The routing controls `preferLatencyUnderMs` and `maxCredits` may be sent in the same JSON body.

## Output

When `output.found` is `true`, `output.data` has this shape:

| Field | Type | Description |
|---|---|---|
| `rows` | object[] | One object per row, keyed by dimension and metric name |
| `columnHeaders` | object[] |  |
| `columnHeaders[].name` | string |  |
| `columnHeaders[].columnType` | string \| null | DIMENSION or METRIC |
| `columnHeaders[].dataType` | string \| null | STRING, INTEGER, FLOAT, … |
| `channel` | string | "MINE" or the channel id the report is for |
| `nextCursor` | string \| null |  |
| `currency` | string | ISO 4217 currency of the revenue metrics |

When the thing you asked about does not exist (or a search matches nothing) the call still succeeds: `output.found` is `false`, `output.data` is `null` and `output.reason` says why (`not_found`, `private`, `no_results`, …). Misses are free unless the notes below say misses are billed.

Pagination: pass the previous response’s `nextCursor` as `cursor` to get the next page; `nextCursor: null` means there are no more results.

## Example request

```bash
curl -sS -X POST "https://api.primaryapi.com/v1/run/youtube.revenue_report" \
  -H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"startDate":"2026-09-01","endDate":"2026-10-31","metrics":["views","estimatedRevenue","cpm"],"dimensions":["month"],"sort":[{"field":"month"}],"currency":"EUR"}'
```

## Example response

_Values are placeholders that follow the output schema; `credits` is what this call would cost at the usual price._

```json
{
  "output": {
    "found": true,
    "data": {
      "rows": [
        {
          "month": "2026-09",
          "views": 41250,
          "estimatedRevenue": 162.37,
          "cpm": 6.12
        },
        {
          "month": "2026-10",
          "views": 47810,
          "estimatedRevenue": 201.94,
          "cpm": 6.48
        }
      ],
      "columnHeaders": [
        {
          "name": "month",
          "columnType": "DIMENSION",
          "dataType": "STRING"
        },
        {
          "name": "views",
          "columnType": "METRIC",
          "dataType": "INTEGER"
        },
        {
          "name": "estimatedRevenue",
          "columnType": "METRIC",
          "dataType": "FLOAT"
        },
        {
          "name": "cpm",
          "columnType": "METRIC",
          "dataType": "FLOAT"
        }
      ],
      "channel": "MINE",
      "currency": "EUR",
      "nextCursor": null
    }
  },
  "provider": "PrimaryAPI",
  "credits": 1,
  "items": 2,
  "requestId": "req_01JBXK6Y2N9V8T4R3Q2P1M0A7Z",
  "nextCursor": null
}
```

## Pricing and reliability

- Usual price: 1 credit per call
- Price ceiling: the usual price, even when a call is retried. A quote’s `maxCredits` is the most a given call can cost; the `maxCredits` routing control caps it per call
- Live 30-day status, success rate, uptime and latency: `GET https://api.primaryapi.com/v1/status/apis?sku=youtube.revenue_report`

## Errors to handle

`invalid_input`, `unauthorized`, `insufficient_balance`, `key_limit_reached`, `trial_cap_reached`, `forbidden`, `not_found`, `idempotency_conflict`, `rate_limited`, `all_sources_failed`, `service_unavailable`, `timeout`. See https://primaryapi.com/docs/errors.

## Notes

Runs as your connected Google account and needs the Read YouTube revenue capability (youtube_revenue_read). Include at least one revenue or ad metric (estimatedRevenue, estimatedAdRevenue, estimatedRedPartnerRevenue, grossRevenue, cpm, adImpressions, monetizedPlaybacks, playbackBasedCpm); views and watch time may be added. Only channels in the YouTube Partner Program have revenue: any other channel answers found=false with reason not_monetized. Revenue figures are YouTube’s estimates, adjusted at month end, converted at daily exchange rates when currency is not USD.

