Menu

Google Trends for any number of keywords in one API call (curl, Python)
📰

Google Trends for any number of keywords in one API call (curl, Python)

DEV Community: datascience·Shrivardhan Hulswar·8 days ago
#J9cDc27y
#devtodatascience#science#devto#dev#rapidapi
Reading 0:00
15s threshold

Google Trends has no official API, and its website compares only 5 terms at a time. I put my Google Trends scraper behind a plain REST endpoint on RapidAPI, so you can send a list of keywords from any language and get JSON back. The free plan gives you 20 calls a month.

One call, many keywords

curl -X POST "https://google-trends-bulk-unlimited-keywords-yoy-growth.p.rapidapi.com/run-sync-get-dataset-items" \ -H "Content-Type: application/json" \ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \ -H "X-RapidAPI-Host: google-trends-bulk-unlimited-keywords-yoy-growth.p.rapidapi.com" \ -d '{"keywords": ["air fryer", "espresso machine", "stand mixer"], "geo": "US", "timeRange": "today 5-y"}'

Enter fullscreen mode

Exit fullscreen mode

Python:

import requests

url = " https://google-trends-bulk-unlimited-keywords-yoy-growth.p.rapidapi.com/run-sync-get-dataset-items " headers = { " X-RapidAPI-Key " : " YOUR_RAPIDAPI_KEY " , " X-RapidAPI-Host " : " google-trends-bulk-unlimited-keywords-yoy-growth.p.rapidapi.com " , } body…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.