Menu

Pull Google Trends data into Python with one API call (no pytrends, no cookies)
📰

Pull Google Trends data into Python with one API call (no pytrends, no cookies)

DEV Community: datascience·Rakshit Solanki·17 days ago
#lwO8kDBt
#devtodatascience#science#devto#dev#terms
Reading 0:00
15s threshold

Disclosure: I built and sell the Apify actor used in this post ( Google Trends Scraper ). It is pay-per-use ($2 per 1,000 search terms that return data; failed or empty terms are not charged). Everything below was run against the real actor on 2026-10-30; the numbers shown are from that run.

If you have ever scripted Google Trends, you know the pain: there is no official API, pytrends breaks whenever Google changes something, and rate limits (HTTP 429) hit quickly from datacenter IPs. In this post I will show a small, dependency-light Python workflow that handles the retries and proxy rotation on the server side, so your code is just "POST JSON, get JSON".

You will end up with a reusable fetch_trends() function, a comparison of several keywords in one Canada-only query, a list of rising related queries, and a CSV you can open in a spreadsheet.

Setup

Create a free Apify account and copy your API token from Settings → Integrations .

pip install requests

Export the token: export APIFY_TOKEN=apify_api_xxx…

Continue reading — create a free account

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