# Google Trends API

> Get Google Trends data for up to five keywords: interest over time, interest by region, related topics and related queries, by country, time range and category.

Source: https://www.sandbase.ai/apis/google/trends
API reference: https://www.sandbase.ai/apis/google/trends#api

## Facts

- Provider: Google
- Type: Data API
- Endpoint: `POST https://api.sandbase.ai/v1/api/google/trends`
- Price: $0.01 per call
- Capabilities: api, google, trends, keywords
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

`POST https://api.sandbase.ai/v1/api/google/trends` with `Authorization: Bearer $SANDBASE_API_KEY` and the parameters as a JSON body.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `q` | string | yes |  |
| `data_type` | string | no |  |
| `hl` | string | no |  |
| `geo` | string | no |  |
| `region` | string | no |  |
| `tz` | string | no |  |
| `cat` | string | no |  |
| `gprop` | string | no |  |
| `date` | string | no |  |
| `csv` | string | no |  |
| `include_low_search_volume` | string | no |  |
| `json_restrictor` | string | no |  |

## FAQ

### How do I use the Google Trends API?

Send a POST request to https://api.sandbase.ai/v1/api/google/trends with your SandBase API key in the Authorization header (Bearer) and the parameters as a JSON body. You can also try it in the Playground on this page without writing code.

### How much does the Google Trends API cost?

$0.01 per call, billed from your SandBase balance. You are only charged for calls you make; there is no subscription.

### What parameters does the Google Trends API accept?

Required: q (string). Optional: data_type (string), hl (string), geo (string), region (string), tz (string) and cat (string) and 5 more. The Parameters table and the Playground on this page list every field.

### What does the Google Trends API return?

A JSON response returned in the same HTTP request (synchronous).

### Do I need a Google developer account or API key?

No. Google Trends runs through SandBase, so one SandBase API key covers this endpoint and every other API and model in the catalog. You do not need to apply for Google API access separately.

## README

### Google Trends

Get Google Trends data for up to five keywords: interest over time, interest by region, related topics and related queries, by country, time range and category.

#### Request

```bash
curl -X POST "https://api.sandbase.ai/v1/api/google/trends" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"q": "coffee,tea", "data_type": "TIMESERIES"}'
```

The result is returned in `outputs[0].data` as structured JSON.

#### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `q` | string | Yes | Parameter defines the query or queries you want to search. You can use anything that you would use in a regular Google Trends search. The maximum number of queries per search is `5` (this only applies to "Interest over time" and "Compared b |
| `data_type` | string | No | Parameter defines the type of search you want to do. Available options: `TIMESERIES` - Interest over time (default) - Accepts both single and multiple queries per search. `GEO_MAP` - Compared breakdown by region - Accepts only multiple quer |
| `hl` | string | No | Parameter defines the language to use for the Google Trends search. It's a two or three-letter language code. (e.g., `en` for English, `es` for Spanish, or `fr` for French), optionally followed by a two-letter or three-digit region code (e. |
| `geo` | string | No | Parameter defines the location from where you want the search to originate. It defaults to `Worldwide` (activated when the value of `geo` parameter is not set or empty). Head to the Google Trends Locations for a full list of supported Googl |
| `region` | string | No | Parameter is used for getting more specific results when using "Compared breakdown by region" and "Interest by region" `data_type` charts. Other `data_type` charts do not accept `region` parameter. The default value depends on the `geo` loc |
| `tz` | string | No | Parameter is used to define a time zone offset. The default value is set to `420` (Pacific Day Time(PDT): -07:00). Value is shown in minutes and can span from `-1439` to `1439`. `tz` can be calculated using the time difference between UTC + |
| `cat` | string | No | Parameter is used to define a search category. The default value is 0 (All categories). You can find or download all supported values in the Google Trends Categories list. Note that these are different from the categories supported for Goog |
| `gprop` | string | No | Parameter is used for sorting results by property. The default property is set to `Web Search` (activated when the value of `gprop` parameter is not set or empty). Other available options: `images` - Image Search `news` - News Search `froog |
| `date` | string | No | Parameter is used to define a date. Available options: `now 1-H` - Past hour `now 4-H` - Past 4 hours `now 1-d` - Past day `now 7-d` - Past 7 days `today 1-m` - Past 30 days `today 3-m` - Past 90 days `today 12-m` - Past 12 months `today 5- |
| `csv` | string | No | Parameter is used for retrieving the CSV results. Set the parameter to `true` to retrieve CSV results as an array. |
| `include_low_search_volume` | string | No | Parameter is used for including low search volume regions in the results. Set the parameter to `true` to include low search volume regions in the results. This parameter is ignored if `data_type` is not set to `GEO_MAP` or `GEO_MAP_0`. |
| `json_restrictor` | string | No | Parameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details. |

#### Pricing

$0.010 per successful call. Failed calls are not charged.
