# Interest over time

Compare normalized search interest for one or two terms or topic IDs over a verified relative time window.

- Platform: [Google Trends](https://docs.upscrape.com/docs/platforms/google_trends)
- Capability ID: `google_trends.interest.over_time`
- 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",
    "terms": [
      "coffee",
      "tea"
    ]
  },
  "capability": "google_trends.interest.over_time"
}'
```

## 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`. |
| `terms` | `array<string>` | Yes |  |

### Example input

```json
{
  "geo": "US",
  "language": "en-US",
  "period": "today 12-m",
  "terms": [
    "coffee",
    "tea"
  ]
}
```

## 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": [
    {
      "formatted_time": "",
      "has_data": [
        true,
        true
      ],
      "is_partial": null,
      "time": "1759017600",
      "values": [
        70,
        33
      ]
    },
    {
      "formatted_time": "",
      "has_data": [
        true,
        true
      ],
      "is_partial": null,
      "time": "1759622400",
      "values": [
        61,
        33
      ]
    },
    {
      "formatted_time": "",
      "has_data": [
        true,
        true
      ],
      "is_partial": null,
      "time": "1760227200",
      "values": [
        61,
        33
      ]
    }
  ],
  "terms": [
    "coffee",
    "tea"
  ]
}
```
### 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` | 3 items |
| `results` | `array` | 3 items |
| `terms` | `array` | 2 items |
| `terms` | `array` | 2 items |

## 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)
