# Search Console Performance (`search-console.performance`)

Clicks, impressions, CTR and average position from Google Search for a Search Console property, grouped by query, page, country, device or date.

Docs: https://primaryapi.com/docs/api-reference/search-console/performance

- Endpoint: `POST https://api.primaryapi.com/v1/run/search-console.performance`
- Category: Search & SEO · Platform: `search-console` · 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=search-console.performance`
- Execution: synchronous (answers 202 only if it outlives the wait window)

## Input

| Field | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
| `siteUrl` | string | yes |  | max 2048 chars | The Search Console property, exactly as search-console.sites lists it: "sc-domain:example.com" for a Domain property, or a URL-prefix property with its trailing slash, e.g. "https://www.example.com/". |
| `startDate` | string | yes |  | pattern: ^\d{4}-\d{2}-\d{2}$ | First day of the range (YYYY-MM-DD, Pacific Time), inclusive. |
| `endDate` | string | yes |  | pattern: ^\d{4}-\d{2}-\d{2}$ | Last day of the range (YYYY-MM-DD, Pacific Time), inclusive; on or after startDate. |
| `dimensions` | enum[] | no | [] | max 8 items | Group rows by these, in this order: query, page, country, device, date, hour, searchAppearance, brandedClassification. Empty (default) = one total row. |
| `type` | enum | no | "web" | one of: web, image, video, news, discover, googleNews, webMultimodal | Search type: web (default), image, video, news, discover, googleNews or webMultimodal. |
| `filters` | object[] | no |  | max 20 items | Filters that must ALL match (Search Console supports only AND between filters). Up to 20. |
| `filters[].dimension` | enum | yes |  | one of: query, page, country, device, searchAppearance, brandedClassification | Dimension to filter on. |
| `filters[].operator` | enum | no | "equals" | one of: equals, notEquals, contains, notContains, includingRegex, excludingRegex | equals (default), notEquals, contains, notContains (case-insensitive), includingRegex or excludingRegex (RE2). |
| `filters[].expression` | string | yes |  | max 4096 chars | Value to match: a query, a page URL, an ISO 3166-1 alpha-3 country ("usa"), DESKTOP/MOBILE/TABLET, a search appearance, or BRANDED/NON_BRANDED. |
| `aggregationType` | enum | no | "auto" | one of: auto, byPage, byProperty, byNewsShowcasePanel | auto (default), byPage, byProperty or byNewsShowcasePanel. Grouping or filtering by page needs auto or byPage. |
| `dataState` | enum | no | "final" | one of: final, all, hourly_all | final (default) = finished data only; all = include fresh data that may still change; hourly_all = with hourly rows (group by hour). |
| `limit` | integer | no | 100 | 1–25000 | Maximum number of results to return (1-25000, default 100). |
| `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. |

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[] |  |
| `rows[].keys` | string[] | Dimension values, in the order of `dimensions` |
| `rows[].dimensions` | object | The same values by dimension name, e.g. { "query": "…" } |
| `rows[].clicks` | number |  |
| `rows[].impressions` | number |  |
| `rows[].ctr` | number | Click-through rate, 0 to 1 |
| `rows[].position` | number | Average position in search results |
| `aggregationType` | string \| null | How Search Console aggregated the rows (auto, byPage, byProperty) |
| `firstIncompleteDate` | string \| null | With dataState "all" grouped by date: values from this date on may still change |
| `firstIncompleteHour` | string \| null | With dataState "hourly_all" grouped by hour: values from this hour on may still change |
| `nextCursor` | string \| null |  |

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/search-console.performance" \
  -H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"siteUrl":"sc-domain:example.com","startDate":"2026-10-01","endDate":"2026-10-31","dimensions":["query"],"limit":2}'
```

## 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": [
        {
          "keys": [
            "running shoes"
          ],
          "dimensions": {
            "query": "running shoes"
          },
          "clicks": 412,
          "impressions": 9230,
          "ctr": 0.0446,
          "position": 6.8
        },
        {
          "keys": [
            "trail running shoes"
          ],
          "dimensions": {
            "query": "trail running shoes"
          },
          "clicks": 120,
          "impressions": 4012,
          "ctr": 0.0299,
          "position": 9.1
        }
      ],
      "aggregationType": "byProperty",
      "firstIncompleteDate": null,
      "firstIncompleteHour": null,
      "nextCursor": "eyJzIjoyfQ"
    }
  },
  "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=search-console.performance`

## 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 Search Console capability (search_console_read). Dates are Pacific Time. By default only finalized data is returned, so the most recent days can be missing; set dataState "all" to include fresh data that may still change. Page through with nextCursor (up to 25,000 rows per call). A property the account cannot see is a miss with reason no_access.

