How to Scrape Google Trends Search Results with TalorData

Learn how to scrape Google Trends search results with TalorData SERP API. This technical guide covers query parameters, Python requests, interest over time, regional data, related queries, related topics, CSV export, and common mistakes.

talor ai
最后更新于
13 分钟阅读

Google Trends is useful when you want to understand what people are searching for before that demand shows up in rankings, traffic, sales, or support tickets.

For SEO and content teams, it helps answer questions like:

Question

Why it matters

Is this topic growing or fading?

Content planning

Which region has stronger interest?

Local SEO and market research

What related queries are rising?

Keyword discovery

Which topics are connected to this query?

Topic clustering

Is demand seasonal?

Campaign planning

Which product or brand is gaining attention?

Competitive monitoring

The problem is that Google Trends is mostly designed as an interface, not as a clean data pipeline. If you need repeatable data collection, dashboards, alerts, or AI workflows, manually checking the Trends website is not enough.

That is where a Google Trends SERP API workflow helps.

With TalorData, you can request Google Trends data through the SERP API layer, configure parameters such as query, category, date range, location, search type, and output options, then parse the response as structured data. The TalorData Google Trends parameter guide lists q as the required search query and includes options such as category and date filters for Google Trends requests.

What can you collect from Google Trends?

Google Trends data is not the same as normal Google Search ranking data. You are not collecting organic results like title, URL, snippet, and position.

Instead, you are usually collecting trend signals.

Common Google Trends data types include:

Data type

What it tells you

Interest over time

How search interest changes across a time range

Interest by region

Where the query is more popular

Related queries

Search terms connected to your keyword

Related topics

Topics connected to your keyword

Rising queries

Queries growing quickly

Top queries

The most relevant related searches

Google’s own Trends website describes Google Trends as a way to explore search interest by time, location, and popularity.

For a technical workflow, the most common use cases are:

Use case

Example

SEO topic research

Track whether “AI agent workflow” is growing

Content planning

Find rising questions around “Google Trends API”

Market research

Compare demand across countries

Product research

Watch interest in brands or product categories

Local strategy

Check which regions search for a topic more

AI agents

Let an agent detect trending topics before writing a report

Basic request structure

The exact endpoint and authentication format should come from your TalorData dashboard or API documentation.

A typical request has this shape:

POST TALORDATA_SERP_ENDPOINT
Authorization: Bearer TALORDATA_API_KEY
Content-Type: application/json

{
  "engine": "google_trends",
  "q": "coffee",
  "date": "today 12-m",
  "geo": "US",
  "cat": "0",
  "data_type": "TIMESERIES"
}

The important idea is simple:

Parameter

Purpose

engine

Select Google Trends

q

Search query

date

Time range

geo

Geographic location

cat

Category

data_type

Type of Trends data to return

tz

Timezone offset

gprop

Search property, such as web, news, images, shopping, or YouTube

Google Trends tools commonly use data types such as TIMESERIES, GEO_MAP, RELATED_QUERIES, and RELATED_TOPICS for interest over time, region interest, related queries, and related topics.

Step 1: Prepare your API key

Store your TalorData API key and endpoint as environment variables.

export TALORDATA_API_KEY="your_api_key_here"
export TALORDATA_SERP_ENDPOINT="your_talordata_serp_endpoint_here"

On Windows PowerShell:

setx TALORDATA_API_KEY "your_api_key_here"
setx TALORDATA_SERP_ENDPOINT "your_talordata_serp_endpoint_here"

Install Python dependencies:

pip install requests pandas

Step 2: Create a reusable Python client

This function sends a Google Trends request to TalorData and returns JSON.

import os
import requests
from typing import Any, Dict, Optional


TALORDATA_API_KEY = os.getenv("TALORDATA_API_KEY")
TALORDATA_SERP_ENDPOINT = os.getenv("TALORDATA_SERP_ENDPOINT")


def fetch_google_trends(
    query: str,
    data_type: str = "TIMESERIES",
    geo: str = "US",
    date: str = "today 12-m",
    cat: str = "0",
    tz: str = "420",
    gprop: Optional[str] = None
) -> Dict[str, Any]:
    """
    Fetch Google Trends data with TalorData SERP API.

    Replace the request body or headers if your TalorData dashboard
    shows a different authentication format.
    """
    if not TALORDATA_API_KEY:
        raise RuntimeError("Missing TALORDATA_API_KEY environment variable.")

    if not TALORDATA_SERP_ENDPOINT:
        raise RuntimeError("Missing TALORDATA_SERP_ENDPOINT environment variable.")

    payload = {
        "engine": "google_trends",
        "q": query,
        "data_type": data_type,
        "geo": geo,
        "date": date,
        "cat": cat,
        "tz": tz
    }

    if gprop:
        payload["gprop"] = gprop

    headers = {
        "Authorization": f"Bearer {TALORDATA_API_KEY}",
        "Content-Type": "application/json"
    }

    response = requests.post(
        TALORDATA_SERP_ENDPOINT,
        json=payload,
        headers=headers,
        timeout=30
    )

    response.raise_for_status()
    return response.json()

Use it like this:

if __name__ == "__main__":
    data = fetch_google_trends(
        query="AI agents",
        data_type="TIMESERIES",
        geo="US",
        date="today 12-m"
    )

    print(data)

Step 3: Get interest over time

Interest over time is usually the first chart people want from Google Trends.

It helps you answer:

Question

Example

Is demand growing?

“AI agents” rising over 12 months

Is demand seasonal?

“Halloween costume” spikes every October

Did a campaign create lift?

Brand query increased after launch

Did interest collapse?

Topic faded after a news cycle

Request:

data = fetch_google_trends(
    query="AI agents",
    data_type="TIMESERIES",
    geo="US",
    date="today 12-m"
)

A Trends response often contains a timeline array with dates, timestamps, and values. The exact field name depends on the response format, but a common structure looks like:

{
  "interest_over_time": {
    "timeline_data": [
      {
        "date": "Jan 1–7, 2026",
        "timestamp": "1767225600",
        "values": [
          {
            "value": "72",
            "extracted_value": 72
          }
        ]
      }
    ]
  }
}

Here is a parser that handles that style of response:

from typing import Any, Dict, List


def parse_interest_over_time(data: Dict[str, Any]) -> List[Dict[str, Any]]:
    timeline = (
        data.get("interest_over_time", {})
        .get("timeline_data", [])
    )

    rows = []

    for item in timeline:
        values = item.get("values", [])

        if not values:
            continue

        first_value = values[0]

        rows.append({
            "date": item.get("date"),
            "timestamp": item.get("timestamp"),
            "value": first_value.get("value"),
            "extracted_value": first_value.get("extracted_value")
        })

    return rows

Save it to CSV:

import pandas as pd


data = fetch_google_trends(
    query="AI agents",
    data_type="TIMESERIES",
    geo="US",
    date="today 12-m"
)

rows = parse_interest_over_time(data)
df = pd.DataFrame(rows)
df.to_csv("google_trends_interest_over_time.csv", index=False)

print(df.head())

Step 4: Compare multiple keywords

Google Trends is often more useful when you compare terms.

Example:

data = fetch_google_trends(
    query="AI agents,RAG,LLM apps",
    data_type="TIMESERIES",
    geo="US",
    date="today 12-m"
)

Use comparison when you want to know:

Comparison

Why it helps

Brand vs competitor

Market demand

Topic A vs topic B

Content priority

Old term vs new term

Language shift

Product category vs feature

User intent

Keyword variants

Better SEO targeting

Be careful when interpreting Trends values. Google Trends values are usually indexed rather than absolute search volume. Google’s Search Central blog explains that Trends data reflects search interest rather than absolute numbers.

That means a score of 100 is not “100 searches.” It usually means the highest relative interest point in the selected scope.

Step 5: Get interest by region

Regional data helps you understand where a topic is stronger.

Request:

data = fetch_google_trends(
    query="electric bike",
    data_type="GEO_MAP",
    geo="US",
    date="today 12-m"
)

This is useful for:

Use case

Example

Local SEO

Which states search for “emergency plumber”?

Market expansion

Where is “EV charger installation” growing?

Ad planning

Which regions deserve campaign budget?

Content localization

Which country uses which term more?

Product demand

Where is a product category gaining interest?

A region response may include data by country, state, metro, or city depending on your request parameters and available data.

A parser can look like this:

def parse_geo_map(data: Dict[str, Any]) -> List[Dict[str, Any]]:
    geo_data = data.get("interest_by_region", [])
    rows = []

    for item in geo_data:
        rows.append({
            "location": item.get("location"),
            "geo_code": item.get("geo_code"),
            "value": item.get("value"),
            "extracted_value": item.get("extracted_value")
        })

    return rows

Because response structures can vary, inspect the first response before hardcoding your parser:

import json

print(json.dumps(data, indent=2, ensure_ascii=False)[:3000])

Small inspection now saves large debugging later. Tiny flashlight, large cave.

Step 6: Get related queries

Related queries are useful for keyword discovery.

Request:

data = fetch_google_trends(
    query="google trends api",
    data_type="RELATED_QUERIES",
    geo="US",
    date="today 12-m"
)

Related queries are commonly split into:

Group

Meaning

Top

Queries most associated with your search term

Rising

Queries growing quickly

This data is useful for:

Workflow

How to use it

SEO keyword research

Find long-tail terms

Content planning

Find article topics

Product marketing

Discover user language

Competitive research

See adjacent demand

AI agents

Generate fresh research directions

Parser:

def parse_related_queries(data: Dict[str, Any]) -> List[Dict[str, Any]]:
    related = data.get("related_queries", {})
    rows = []

    for group_name in ["top", "rising"]:
        for item in related.get(group_name, []):
            rows.append({
                "group": group_name,
                "query": item.get("query"),
                "value": item.get("value"),
                "extracted_value": item.get("extracted_value"),
                "link": item.get("link")
            })

    return rows

Save to CSV:

data = fetch_google_trends(
    query="google trends api",
    data_type="RELATED_QUERIES",
    geo="US",
    date="today 12-m"
)

rows = parse_related_queries(data)
pd.DataFrame(rows).to_csv("related_queries.csv", index=False)

Step 7: Get related topics

Related topics are useful when a search term has many meanings.

For example, “python” could mean a programming language or an animal. Topic data helps you understand the semantic neighborhood around a query.

Request:

data = fetch_google_trends(
    query="python",
    data_type="RELATED_TOPICS",
    geo="US",
    date="today 12-m"
)

Parser:

def parse_related_topics(data: Dict[str, Any]) -> List[Dict[str, Any]]:
    related = data.get("related_topics", {})
    rows = []

    for group_name in ["top", "rising"]:
        for item in related.get(group_name, []):
            topic = item.get("topic", {})

            rows.append({
                "group": group_name,
                "topic_title": topic.get("title"),
                "topic_type": topic.get("type"),
                "topic_id": topic.get("value") or item.get("id"),
                "value": item.get("value"),
                "extracted_value": item.get("extracted_value"),
                "link": item.get("link")
            })

    return rows

This is especially helpful for:

Use case

Example

Entity SEO

Understand related entities

Topic clustering

Build content hubs

AI search

Feed related topics into an agent

Market research

Detect adjacent categories

Brand research

See which topics surround a brand

Step 8: Use categories

The cat parameter lets you narrow the query by category. The TalorData Google Trends parameter guide includes cat as an optional category parameter and notes that the default value is 0, meaning all categories.

Example:

data = fetch_google_trends(
    query="apple",
    data_type="TIMESERIES",
    geo="US",
    date="today 12-m",
    cat="5"
)

This matters when a query has multiple meanings.

Query

Possible meanings

apple

Fruit, company, music, device

jaguar

Animal, car brand, sports team

python

Snake, programming language

java

Coffee, island, programming language

Using categories can reduce noise.

Step 9: Use search properties

The gprop parameter is commonly used to specify the Google property:

gprop value

Meaning

empty

Web Search

images

Image Search

news

News Search

froogle

Google Shopping

youtube

YouTube Search

This lets you ask more precise questions.

Examples:

# News interest
data = fetch_google_trends(
    query="AI regulation",
    data_type="TIMESERIES",
    geo="US",
    date="today 3-m",
    gprop="news"
)

# YouTube interest
data = fetch_google_trends(
    query="python tutorial",
    data_type="TIMESERIES",
    geo="US",
    date="today 12-m",
    gprop="youtube"
)

For SEO, this matters because search behavior differs by surface. A topic may be flat in web search but rising on YouTube or News.

Step 10: Build a complete script

Here is a complete script that collects interest over time and related queries.

import os
import json
import requests
import pandas as pd
from typing import Any, Dict, List, Optional


TALORDATA_API_KEY = os.getenv("TALORDATA_API_KEY")
TALORDATA_SERP_ENDPOINT = os.getenv("TALORDATA_SERP_ENDPOINT")


def fetch_google_trends(
    query: str,
    data_type: str = "TIMESERIES",
    geo: str = "US",
    date: str = "today 12-m",
    cat: str = "0",
    tz: str = "420",
    gprop: Optional[str] = None
) -> Dict[str, Any]:
    if not TALORDATA_API_KEY:
        raise RuntimeError("Missing TALORDATA_API_KEY environment variable.")

    if not TALORDATA_SERP_ENDPOINT:
        raise RuntimeError("Missing TALORDATA_SERP_ENDPOINT environment variable.")

    payload = {
        "engine": "google_trends",
        "q": query,
        "data_type": data_type,
        "geo": geo,
        "date": date,
        "cat": cat,
        "tz": tz
    }

    if gprop:
        payload["gprop"] = gprop

    response = requests.post(
        TALORDATA_SERP_ENDPOINT,
        json=payload,
        headers={
            "Authorization": f"Bearer {TALORDATA_API_KEY}",
            "Content-Type": "application/json"
        },
        timeout=30
    )

    response.raise_for_status()
    return response.json()


def parse_interest_over_time(data: Dict[str, Any]) -> List[Dict[str, Any]]:
    timeline = data.get("interest_over_time", {}).get("timeline_data", [])
    rows = []

    for item in timeline:
        values = item.get("values", [])

        if not values:
            continue

        first_value = values[0]

        rows.append({
            "date": item.get("date"),
            "timestamp": item.get("timestamp"),
            "value": first_value.get("value"),
            "extracted_value": first_value.get("extracted_value")
        })

    return rows


def parse_related_queries(data: Dict[str, Any]) -> List[Dict[str, Any]]:
    related = data.get("related_queries", {})
    rows = []

    for group_name in ["top", "rising"]:
        for item in related.get(group_name, []):
            rows.append({
                "group": group_name,
                "query": item.get("query"),
                "value": item.get("value"),
                "extracted_value": item.get("extracted_value"),
                "link": item.get("link")
            })

    return rows


def main() -> None:
    query = "google trends api"

    trend_data = fetch_google_trends(
        query=query,
        data_type="TIMESERIES",
        geo="US",
        date="today 12-m"
    )

    trend_rows = parse_interest_over_time(trend_data)
    pd.DataFrame(trend_rows).to_csv("interest_over_time.csv", index=False)

    related_data = fetch_google_trends(
        query=query,
        data_type="RELATED_QUERIES",
        geo="US",
        date="today 12-m"
    )

    related_rows = parse_related_queries(related_data)
    pd.DataFrame(related_rows).to_csv("related_queries.csv", index=False)

    with open("raw_google_trends_response.json", "w", encoding="utf-8") as file:
        json.dump({
            "timeseries": trend_data,
            "related_queries": related_data
        }, file, ensure_ascii=False, indent=2)

    print("Saved interest_over_time.csv")
    print("Saved related_queries.csv")
    print("Saved raw_google_trends_response.json")


if __name__ == "__main__":
    main()

How to use this data

Once you have Google Trends data in CSV or JSON, you can use it in several workflows.

Workflow

How Trends data helps

SEO planning

Prioritize growing topics

Content calendar

Time articles around seasonal demand

Competitor monitoring

Compare brand interest

Product research

Detect category growth

Local marketing

Choose regions to target

AI agents

Feed trend signals into planning tasks

RAG pipelines

Store trend snapshots as structured context

Example content workflow:

Google Trends API
   ↓
Collect related rising queries
   ↓
Cluster queries by topic
   ↓
Check SERP competition
   ↓
Generate content brief
   ↓
Track performance over time

Trends data should not replace keyword volume, ranking data, or conversion data. It is a signal layer. Used well, it tells you where attention is moving before the traffic report knocks on your door wearing muddy boots.

Common mistakes

Mistake 1: Treating Trends values as search volume

Google Trends values are indexed interest scores, not exact search counts. A value of 100 means peak relative interest in the selected scope.

Mistake 2: Comparing different requests without context

Always store:

Context

Query

Geo

Date range

Category

Search property

Data type

Timezone

Collection timestamp

Without context, the numbers become decorative confetti.

Mistake 3: Ignoring categories

Ambiguous terms need categories. Otherwise, the data may mix unrelated intent.

Mistake 4: Only using interest over time

Related queries and related topics are often more actionable for SEO and content planning.

Mistake 5: Not saving raw responses

Always save the raw JSON while building your parser. It helps when fields change or when you need to debug.

Final thoughts

Scraping Google Trends search results with TalorData is mainly about turning an interactive Trends workflow into a repeatable data pipeline.

Start with the core parameters:

Parameter

Start with

q

Your topic or keyword

data_type

TIMESERIES, GEO_MAP, RELATED_QUERIES, or RELATED_TOPICS

geo

Country or region

date

Time range

cat

Category

gprop

Web, news, images, shopping, or YouTube

tz

Timezone offset

Then parse the response into clean tables: interest over time, regional interest, related queries, and related topics.

Once that data is structured, it can power SEO planning, market research, dashboards, alerts, and AI agents.

Google Trends is where search demand whispers before it becomes a roar. A good API workflow helps you hear it early.

Test Google Trends API for free now

FAQ

Can I scrape Google Trends data with TalorData?

Yes. TalorData provides Google Trends parameters through its SERP API documentation, including query, category, date range, geographic and advanced configuration options.

What is the most useful Google Trends data type?

For most SEO and marketing workflows, start with TIMESERIES for interest over time, then use RELATED_QUERIES and RELATED_TOPICS for content ideas and keyword discovery.

Are Google Trends values the same as search volume?

No. Google Trends values are relative interest scores, not absolute search volume. Google explains that Trends values reflect search interest rather than exact search counts.

Can I compare multiple keywords?

Yes, but keep the same date range, geo, category, and search property. Otherwise, the comparison can become noisy.

立即开展您的数据业务

加入全球最强大的代理网络

免费试用