![]()
Google Trends API for Python, JavaScript & AI agents
Get Google Trends data as clean JSON in one call: interest over time (with growth %), interest by region, rising queries, Trending Now with search volume, and keyword ranking beyond 5 terms. The maintained alternative to the archived pytrends.
Quick start in Python
pip install "apify-client>=3"
from apify_client import ApifyClient
client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("victorrodi/google-trends-api").call(run_input={
"searchTerms": ["iphone, samsung, pixel"],
"geo": "US",
"timeRange": "today 12-m",
})
for item in client.dataset(run.default_dataset_id).iterate_items():
print(item["type"], item.get("summary"))
What Google Trends data you get
| Data | Input |
|---|---|
| Interest over time with average, peak and growth % | searchTerms, timeRange |
| Interest by region: countries, states, cities, US metros | dataTypes: ["interestByRegion"] |
| Related queries, top and rising, including "Breakout" | dataTypes: ["relatedQueries"] |
| Trending Now: search volume, growth, categories, news (4 h to 7 days) | trendingNowGeos: ["US"] |
| Rank any number of keywords on one 0-100 scale | keywordRanking: true |
| YouTube, News, Shopping and Image search trends | property |
Migrating from pytrends
| pytrends | This API |
|---|---|
build_payload(kw_list, timeframe, geo, cat, gprop) | searchTerms, timeRange, geo, category, property |
interest_over_time() | dataTypes: ["interestOverTime"] |
interest_by_region() | dataTypes: ["interestByRegion"] |
related_queries() | dataTypes: ["relatedQueries"] |
trending_searches(), realtime_trending_searches() | trendingNowGeos, trendingNowHours |
TooManyRequestsError (429) | Handled for you: retries, new IPs, residential fallback |
JavaScript / Node.js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('victorrodi/google-trends-api').call({ trendingNowGeos: ['US'] });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
Use Google Trends from Claude, ChatGPT and Cursor (MCP)
Add the Apify MCP server with --actors victorrodi/google-trends-api, then ask your assistant: "What is trending on Google in the UK right now?"
Pricing
About $0.0025 per result, platform and proxies included, less on higher Apify plans. Empty results are never charged. Every Apify account gets monthly free credit.
FAQ
Is there an official Google Trends API?
Google opened an alpha API to a small group of testers only. This API returns the same data today, with no application or quota.
What is the best pytrends alternative?
pytrends was archived in April 2025 and often fails with HTTP 429 errors. This hosted API covers the same functions and handles blocking, retries and proxies for you.
Can I compare more than 5 keywords?
Yes. Set keywordRanking: true: terms are queried in batches sharing an anchor term and rescaled onto one 0-100 scale.
Does Google Trends give search volume?
Explore data is a relative 0-100 index. Trending Now items include the approximate search volume shown by Google, and this API returns it.
How much does it cost?
About $0.0025 per result on the Apify Starter plan. Empty results are never charged.