# Interest by region

Return regional relative interest for a term or topic ID; missing data remains distinct from zero.

- Platform: [Google Trends](https://docs.upscrape.com/docs/platforms/google_trends)
- Capability ID: `google_trends.interest.by_region`
- Cost: 1 credit per request
- Maximum runtime: 60 seconds
- Execute endpoint: `POST https://data.upscrape.com/execute`

## Request

Use the exact public capability ID in the shared execute envelope.

```bash
curl --request POST \
  --url https://data.upscrape.com/execute \
  --header "Authorization: Bearer $UPSCRAPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Prefer: wait=30" \
  --data '{
  "input": {
    "geo": "US",
    "language": "en-US",
    "period": "today 12-m",
    "term": "coffee"
  },
  "capability": "google_trends.interest.by_region"
}'
```

## Input


| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `geo` | `string` | No | Country code; empty means worldwide. Assigned codes are validated before network access. |
| `language` | `string` | No | Language for returned content. Default: `en-US`. |
| `period` | `string` | No | Allowed values: `today 12-m`, `today 5-y`. Default: `today 12-m`. |
| `term` | `string` | Yes | Search term or verified Google topic ID beginning /m/ or /g/. |

### Example input

```json
{
  "geo": "US",
  "language": "en-US",
  "period": "today 12-m",
  "term": "coffee"
}
```

## Response

Successful output is returned in `results[0].data`.

Raw platform output is intentionally open-ended and may evolve with the upstream source.

### Illustrative sample output

This example shows one response. Values and optional fields vary with the data available.

```json
{
  "geo": "US",
  "language": "en-US",
  "period": "today 12-m",
  "results": [
    {
      "geo_code": "US-WY",
      "geo_name": "Wyoming",
      "has_data": null,
      "value": 100
    },
    {
      "geo_code": "US-KS",
      "geo_name": "Kansas",
      "has_data": null,
      "value": 41
    }
  ],
  "term": "coffee"
}
```
### Illustrative output fields

Derived from the sample above for orientation only. These fields are not a fixed response schema.

| Path | Observed type | Example |
| --- | --- | --- |
| `geo` | `string` | US |
| `language` | `string` | en-US |
| `period` | `string` | today 12-m |
| `results` | `array` | 2 items |
| `results` | `array` | 2 items |
| `term` | `string` | coffee |

## Execution behavior

A `200` response completed inline. A `202` response was queued; poll `GET /jobs/{id}` until the job reaches `completed` or `failed`. Use an `Idempotency-Key` when retrying must not create a duplicate logical job.

## Related documentation

- [Authentication](https://docs.upscrape.com/docs/api/authentication)
- [Jobs and results](https://docs.upscrape.com/docs/api/jobs)
- [Errors and retries](https://docs.upscrape.com/docs/api/errors)
- [Idempotency](https://docs.upscrape.com/docs/api/idempotency)
