# Google Trends

#### SERP API Google Query Parameters

Configure Google search queries using Thordata’s SERP API, including Geographical Location parameters, search type, and "advanced parameter" output options.

<details>

<summary><strong><code>q</code> ,</strong>Search Query<strong>(Required)</strong></summary>

Define the search query used for data scraping (Default value: `q=pizza`). Any keywords in any language are supported.

**Example Request:**\
Example using the parameter `q`: pizza

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_trends" \
 -d "q=pizza" \
 -d "json=1"
```

</details>

## Geographical Location

<details>

<summary><strong><code>hl</code> ,</strong>Language<strong>(Optional)</strong></summary>

Set the interface language for search results (default value: `en`). Adopt standard language code formats (e.g., `en`, `es`, `zh-CN`).

For the complete list of supported language codes, please refer to: [Google Language Codes](https://developers.google.com/google-ads/api/docs/start).

**Example Request:**

Example results for `q` : <mark style="color:blue;">pizza</mark>,`hl`: <mark style="color:blue;">es</mark>

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_trends" \
 -d "q=pizza" \
 -d "json=1" \
 -d "hl=es"
```

</details>

<details>

<summary><strong><code>geo</code> ,</strong>Location<strong>(Optional)</strong></summary>

The parameter defines the location you wish to search from. It defaults to Worldwide (activated when the value of the `geo` parameter is not set or is empty). Go to Google Trends Locations for a complete list of supported Google Trends locations.

**Example Request:**

Example results for `q` : <mark style="color:blue;">pizza</mark>,`geo`:<mark style="color:blue;">India</mark>

```
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_trends" \
 -d "q=pizza" \
 -d "json=1" \
 -d "geo=India"
```

</details>

<details>

<summary><strong><code>region</code>,</strong>Region<strong>(Optional)</strong></summary>

The parameter is used to get more specific results when using the "By Region Comparison Segment" and "By Region by Interest"data\_type charts. Other data\_type charts do not accept the region parameter. The default value depends on the set geography. Available options:

`COUNTRY` - Country

`REGION` - Subregion

`DMA` - Metro

`CITY` - City

**Example Request:**

Example results for `q` : <mark style="color:blue;">pizza</mark>,`region`:COUNTRY

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_trends" \
 -d "q=pizza" \
 -d "json=1" \
 -d "region=COUNTRY"
```

</details>

## Search Type

<details>

<summary><code>data_type</code> <strong>,</strong>data_type<strong>(Optional)</strong></summary>

Parameter defines the type of search you want to do. Available options:

`TIMESERIES` - Interest over time - Accepts both single and multiple queries per search.

`GEO_MAP` - Compared breakdown by region - Accepts only multiple queries per search.

`GEO_MAP`\_0 - Interest by region - Accepts only single query per search.

`RELATED`\_TOPICS - Related topics - Accepts only single query per search.

`RELATED`\_QUERIES - Related queries - Accepts only single query per search.

**Example Request:**

Example results for `q` : <mark style="color:blue;">pizza</mark>,`data_type`:TIMESERIES

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_trends" \
 -d "q=pizza" \
 -d "json=1" \
 -d "data_type=TIMESERIES"
```

</details>

## Advanced Parameters

<details>

<summary><code>tz</code><strong>,</strong>Time Zone<strong>(Optional)</strong></summary>

The parameter defines the time zone offset. The default value is `420` (Pacific Daylight Time (PDT): -07:00). The value is in minutes and ranges from `-1439 to 1439`. tz can be calculated using the difference between UTC+0 and the desired time zone. Example: -PDT

**Example Request:**

Example results for `q` : <mark style="color:blue;">pizza</mark>,`tz`:-1439 to 1439

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_trends" \
 -d "q=pizza" \
 -d "json=1" \
 -d "tz=-1439 to 1439"
```

</details>

<details>

<summary><code>cat</code>,Category <strong>(Optional)</strong></summary>

The parameter defines the search category. The default value is `0` (all categories).&#x20;

**Example Request:**

Example results for `q` : <mark style="color:blue;">pizza</mark>,`cat`:<mark style="color:blue;">7</mark>

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_trends" \
 -d "q=pizza" \
 -d "json=1" \
 -d "cat=7"
```

</details>

<details>

<summary><code>gprop</code> <strong>,</strong>Property<strong>(Optional)</strong></summary>

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

`froogle` - Google Shopping

`youtube` - YouTube Search

**Code Example:**

Example results for `q` : <mark style="color:blue;">pizza</mark>,`gprop`:froogle

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_trends" \
 -d "q=pizza" \
 -d "json=1" \
 -d "gprop=froogle"
```

</details>

<details>

<summary><code>date</code> <strong>,</strong>Date<strong>(Optional)</strong></summary>

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-y` - Past 5 years

`all - 2004` - present

You can also pass custom values:

Dates from 2004 to present: yyyy-mm-dd yyyy-mm-dd (e.g., 2021-10-15 2022-05-25)

**Code Example:**

Example results for `q` : <mark style="color:blue;">pizza</mark>,`date`:now 1-H

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_trends" \
 -d "q=pizza" \
 -d "json=1" \
 -d "date=now 1-H"
```

</details>

For further assistance, contact us at **<support@thordata.com>**.
