Skip to main content
GET
/
v1
/
google
/
trends
/
search
Google Trends — unified search
curl --request GET \
  --url https://scrapebadger.com/v1/google/trends/search \
  --header 'x-api-key: <api-key>'
import requests

url = "https://scrapebadger.com/v1/google/trends/search"

headers = {"x-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://scrapebadger.com/v1/google/trends/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/google/trends/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://scrapebadger.com/v1/google/trends/search"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-api-key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/google/trends/search")
.header("x-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://scrapebadger.com/v1/google/trends/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "query": "<string>",
  "data_type": "<string>",
  "timeline": [
    {
      "date": "<string>",
      "timestamp": 123,
      "values": [
        {
          "query": "<string>",
          "value": 123,
          "extracted_value": 123
        }
      ]
    }
  ],
  "averages": [
    {
      "query": "<string>",
      "value": 123,
      "extracted_value": 123
    }
  ],
  "regions": [
    {
      "region": "<string>",
      "region_code": "<string>",
      "value": 0,
      "max_value_index": 0
    }
  ],
  "top_topics": [
    {
      "title": "<string>",
      "value": "<string>",
      "link": "<string>",
      "topic_id": "<string>",
      "topic_type": "<string>"
    }
  ],
  "rising_topics": [
    {
      "title": "<string>",
      "value": "<string>",
      "link": "<string>",
      "topic_id": "<string>",
      "topic_type": "<string>"
    }
  ],
  "top_queries": [
    {
      "title": "<string>",
      "value": "<string>",
      "link": "<string>",
      "topic_id": "<string>",
      "topic_type": "<string>"
    }
  ],
  "rising_queries": [
    {
      "title": "<string>",
      "value": "<string>",
      "link": "<string>",
      "topic_id": "<string>",
      "topic_type": "<string>"
    }
  ]
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Authorizations

x-api-key
string
header
required

Query Parameters

q
string
required

Search term(s). Up to 5 comma-separated terms for TIMESERIES / GEO_MAP; single term for GEO_MAP_0 / RELATED_TOPICS / RELATED_QUERIES. Also accepts a topic MID.

data_type
enum<string>
default:TIMESERIES

Dispatch on: TIMESERIES (interest over time), GEO_MAP (compared breakdown, multi-query), GEO_MAP_0 (interest by region, single query), RELATED_TOPICS (top + rising topics), RELATED_QUERIES (top + rising queries).

Available options:
TIMESERIES,
GEO_MAP,
GEO_MAP_0,
RELATED_TOPICS,
RELATED_QUERIES
geo
string
default:""

Country / region code (e.g. US, GB, US-CA).

date
string
default:today 12-m

Time range.

cat
integer
default:0

Category filter ID (0 = all).

gprop
string
default:""

Property filter: "" (web), "images", "news", "froogle", "youtube".

region
string | null

Geo resolution for GEO_MAP / GEO_MAP_0: COUNTRY / REGION / DMA / CITY. Omit to use the widget's own default.

language
string | null

Alias for hl. Defaults to en-US.

tz
string
default:0

Timezone offset in minutes.

Response

Successful Response

Unified response for GET /api/v1/trends/search.

A single endpoint that dispatches on data_type (TIMESERIES, GEO_MAP, GEO_MAP_0, RELATED_TOPICS, RELATED_QUERIES). Only the field set relevant to the requested data_type is populated; others stay at their empty defaults.

query
string
required
data_type
string
required
timeline
TrendsTimelinePoint · object[]
averages
TrendsTimelineValue · object[]
regions
TrendsRegionInterest · object[]
top_topics
TrendsRelatedItem · object[]
rising_topics
TrendsRelatedItem · object[]
top_queries
TrendsRelatedItem · object[]
rising_queries
TrendsRelatedItem · object[]