# Google Trends API

Give one or more keywords, get a time series of relative interest plus related rising queries.

- endpoint: `GET https://marketplaceforaiagents.com/api/public/v1/google-trends`
- category: trends
- price: $0.005 USDC per call (5000 atomic, 6 decimals)
- free tier: 3 calls per agent identity, shared across all endpoints (unknown/generic clients draw from a site-wide 100 successful free calls per UTC day; crawlers get none)
- settlement: USDC on Base mainnet `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`, payee `0x05e82e03753c7bc99fb24d10a876cce53f24b7b7`, scheme `exact`
- sandbox: append `?network=base-sepolia` for testnet USDC + mock data
- results key: `interest_over_time`
- html: https://marketplaceforaiagents.com/listings/google-trends

## What it returns

Interest-over-time, regional interest, and related queries from Google Trends.

## Use cases

- Detect emerging topics
- Compare keyword momentum before a campaign

## Parameters

| param | type | required | default | description |
| --- | --- | --- | --- | --- |
| `q` | string | yes | — | Trend query (comma-separated to compare up to 5 terms) |
| `geo` | string | no | — | Country code, e.g. US |
| `date` | string | no | — | Time range, e.g. today 12-m |
| `data_type` | string | no | TIMESERIES | TIMESERIES | GEO_MAP | RELATED_QUERIES | RELATED_TOPICS |

## Example call

```bash
curl -s "https://marketplaceforaiagents.com/api/public/v1/google-trends?q=example"
```

## Response shape

```json
{
  "search_metadata": {
    "id": "search_...",
    "status": "Success"
  },
  "search_parameters": {
    "engine": "google_trends",
    "q": "AI agents"
  },
  "interest_over_time": [
    {
      "timestamp": "2026-01-01",
      "value": 42
    }
  ],
  "related_queries": [
    {
      "query": "autonomous agents",
      "value": 100
    }
  ]
}
```

## Payment

1. Call without `X-PAYMENT`. The first 3 calls per identity (across all endpoints) return 200 with an `X-Free-Calls-Remaining` header.
2. After that the response is `402` with an `accepts[]` requirement.
3. Sign the EIP-3009 USDC authorization, base64 the x402 payload, resend as `X-PAYMENT`.
4. Settlement receipt returns in the `X-PAYMENT-RESPONSE` header.
