Developer tutorial
How to scrape Google Trends data with Node.js (2026)
This tutorial shows how to scrape Google Trends data in Node.js using the SocialCrawl API. You get interest-over-time and related rising queries for one or more keywords, since Google publishes no official Trends API from one GET request, with no Google Trends developer account, proxies, or HTML parsing. The code below is runnable as-is, and the response underneath it is a real, unedited call.
Code tested July 2026
How it works
- 1Get a free API keyCreate a SocialCrawl account and copy your API key from the dashboard. Every new account starts with free credits.
- 2Set up Node.jsUse Node.js 18 or newer, which includes the fetch API with no extra packages.
- 3Call the Google Trends Explore endpointSend a GET request to /v1/google_trends/explore with your API key in the x-api-key header and the `keywords` and `timeframe` parameters.
- 4Read the responseParse the JSON. SocialCrawl returns interest-over-time and related rising queries for one or more keywords, since Google publishes no official Trends API in one normalized schema, so you write no HTML parsing or proxy code.
The code
A real, unedited response from the request above.
const params = new URLSearchParams({
"keywords": "uv index",
"timeframe": "past_90_days",
});
const response = await fetch(
`https://www.socialcrawl.dev/v1/google_trends/explore?${params}`,
{ headers: { "x-api-key": "YOUR_API_KEY" } },
);
const data = await response.json();
console.log(data);[ RESPONSE ]
{
"success": true,
"platform": "google_trends",
"endpoint": "/v1/google_trends/explore",
"data": {
"series": [
{
"keyword": "uv index",
"points": [
{
"date": "2026-04-20",
"datetime": "2026-04-20T00:00:00.000Z",
"value": 30
},
{
"date": "2026-04-21",
"datetime": "2026-04-21T00:00:00.000Z",
"value": 37
}
]
}
],
"averages": [
{
"keyword": "uv index",
"value": 55
}
]
},
"credits_used": 5,
"credits_remaining": 9999,
"request_id": "req_example000000",
"cached": false
}Prefer another language?
FAQ
Have a question? We got answers
Find answers to frequently asked questions about SocialCrawl's API, pricing, and capabilities.
Contact usDo I need a Google Trends developer account to scrape Google Trends data?
No. SocialCrawl handles authentication and proxies upstream, so you never register a Google Trends app, manage OAuth tokens, or run your own scrapers. One API key returns Google Trends data directly.
What does the Google Trends Explore endpoint return?
It returns interest-over-time and related rising queries for one or more keywords, since Google publishes no official Trends API. The response is normalized into SocialCrawl's unified schema, identical in shape across every platform.
How much does it cost to scrape Google Trends data?
Each call costs a small number of credits, and new accounts start with free credits. There are no monthly minimums, so you pay only for the calls you make.
Can I use this Node.js code in production?
Yes. The snippet on this page is the real request against the live API. For production, add error handling and follow the response cursor to paginate through large result sets.
Ask AI about SocialCrawl
