The Google Trends API for interest over time
Send up to five terms or topic IDs to get interest over time as JSON. Filter by country and timeframe to match your question.
Google Trends Interest API at a glance
This API returns Google Trends interest over time as JSON. Send a POST request with keywords, then read the timeline. Copy the request below to see a live timeline.
- Endpoint
POST /v1/data/google-trends/interest- Authentication
- API key as
Authorization: Bearer wh_… - Stage
- Stable
- Output
- A timeline array with time, formatted_time, values, has_data and formatted_values, plus total_points
- Terms per request
- One to five search terms or topic IDs in keywords
- Timeframe
- Set timeframe to values like today 12-m, now 7-d or today 5-y. The default is today 12-m.
- Region
- geo takes a code such as IN or US. Leave it empty for worldwide.
- Vertical
- property_name is empty for Web Search, or set it to images, news, youtube or froogle
- Timeout
- timeout_ms from 5000 to 90000. The default is 30000.
- Credit weight
- 1. See the pricing page for current rates.
One request, structured JSON.
This request charts the espresso machine topic for the US. The keyword is a topic ID from Google Trends Autocomplete. The response shows three of the 93 daily points returned. Paste the request into a terminal to run it.
curl -X POST "https://api.datablue.dev/v1/data/google-trends/interest" \
-H "Authorization: Bearer wh_..." \
-H "Content-Type: application/json" \
-d '{
"keywords": ["/m/01vk_m"],
"geo": "US",
"timeframe": "today 3-m",
"hl": "en-US",
"timezone": -330
}'{
"success": true,
"source": "google_trends",
"operation": "interest",
"keywords": ["/m/01vk_m"],
"geo": "US",
"timeframe": "today 3-m",
"property_name": "",
"total_points": 93,
"timeline": [
{
"time": "1794614400",
"formatted_time": "Nov 14, 2026",
"formatted_axis_time": "Nov 14",
"values": { "/m/01vk_m": 90 },
"has_data": { "/m/01vk_m": true },
"formatted_values": { "/m/01vk_m": "90" }
},
{
"time": "1794700800",
"formatted_time": "Nov 15, 2026",
"formatted_axis_time": "Nov 15",
"values": { "/m/01vk_m": 100 },
"has_data": { "/m/01vk_m": true },
"formatted_values": { "/m/01vk_m": "100" }
},
{
"time": "1794787200",
"formatted_time": "Nov 16, 2026",
"formatted_axis_time": "Nov 16",
"values": { "/m/01vk_m": 82 },
"has_data": { "/m/01vk_m": true },
"formatted_values": { "/m/01vk_m": "82" }
}
]
}What each point returns.
The timeline holds one object per point in time.
Time
Each point has a time field holding a Unix timestamp. Use formatted_time for a date like Nov 15, 2026.
Axis label
Each point has a short label called formatted_axis_time, so use it to label the axis of a chart.
Values
The values object maps each keyword to its number. The sample reads 100 on Nov 15 and 82 on Nov 16 for this topic.
Data flag
has_data holds a true or false flag for each keyword, so check the flag before you chart a point.
Formatted values
The formatted_values object returns the same numbers as strings, so show them in a tooltip or table as they are.
Totals
The response reports total_points, which was 93 in this sample. Compare it with the length of your timeline.
Options that shape your timeline.
Every request needs keywords and nothing else. Add options below to narrow what Google Trends returns.
Keywords
Pass one to five terms or topic IDs as keywords, and get topic IDs from Google Trends Autocomplete.
Region
Set geo to a code such as US or IN, or leave geo empty to get worldwide data.
Timeframe
Set timeframe to values like now 7-d or today 5-y, with today 12-m as the default.
Vertical
Set property_name to news or youtube to switch the vertical. Leave it empty for Web Search, which is the default.
Locale and timezone
Use hl for the locale and timezone for the offset. Their defaults are en-US and -330 respectively.
Timeout
Set timeout_ms from 5000 to 90000 for the provider timeout, with 30000 as the default.
Comparing terms
Send two to five keywords to compare them together. Read each keyword from the values object.
What teams build with it.
Timelines turn search interest into numbers you chart.
Seasonality tracking
Request a twelve month window for a product topic. Find the weeks where interest peaks in the window.
Launch monitoring
Pull now 7-d for a brand topic on a schedule, then store each timeline to compare launches later.
Regional comparison
Query one topic for US, then query it for IN. Compare the two timelines side by side.
Vertical research
Switch property_name to youtube to read that vertical. Compare it with the Web Search timeline.
Why use an API instead of collecting trends yourself.
Google Trends draws charts for people in a browser, but your code needs the numbers as data. This API returns each point as a JSON object.
DataBlue handles the request to Google Trends for you. You choose keywords and a timeframe, then read the timeline. The timeout_ms option sets the provider timeout for each request.
A topic ID names one subject, such as Espresso machine. Get the ID from Trends Autocomplete, then pass it here. Run both calls in one script to chart any keyword.
Your first timeline in a minute.
Get a key, resolve a topic and chart it.
Create an account
Create your account to get a Bearer key.
Find a topic ID
Call Google Trends Autocomplete with a keyword and read the mid of the topic you want.
Chart the topic
POST that mid in keywords to /v1/data/google-trends/interest. Read the timeline array and plot each point.
Google Trends API questions.
These answers cover timelines and billing before you start.
It returns Google Trends interest over time as JSON. Each point holds a time and one value per keyword.
Still have a question?Ask us anything
Send a POST request to /v1/data/google-trends/interest with keywords. Add geo and timeframe to narrow the data.
Send one to five terms or topic IDs as keywords. Each one gets its own number in the values object.
Call Google Trends Autocomplete with a keyword. Read its mid, then pass it as a keyword.
Try timeframe values such as now 7-d or today 5-y. When you leave it out the default is today 12-m.
Set property_name to youtube or news to switch the vertical. An empty value means Web Search, the default.
Set geo to a code such as US or IN. Leave geo empty to read worldwide interest.
Autocomplete finds the topic ID for a keyword, and this API charts that ID over your chosen timeframe.
This API is stable, so build against the documented fields. Check the changelog before each upgrade you ship.
This API has a credit weight of 1. Check the pricing page for current rates.
Chart Google Trends interest in a minute.
Sign up to get your API key. Then run the example and read the timeline.
Start free
