Skip to content
Coding Script or NotebookGoogle ColabFree

PyTrends Google Trends API Notebook (2026 Refresh)

ForKeyword researchReporting

By Lazarina Stoy· Updated 5 Dec 2026

Google Trends has no open public API yet, so most SEOs reach for PyTrends, the unofficial Python library. The catch is that several of its methods stopped working when Google changed its endpoints, and its GitHub repository was archived in April 2025. This free Google Colab notebook is the tested 2026 version: every method that still works, workarounds for the ones that don’t, and polite rate-limit handling so you get data instead of errors.

Who it’s for

SEOs, content strategists and analysts who want seasonality, regional interest, rising queries or a share-of-search view for a keyword set, without copying charts out of the Google Trends website one at a time. It is also a practical way to check whether a topic is seasonal before you plan content around it, or whether interest is growing or fading over several years. No API key is needed.

How to use it

  1. Open the notebook in Colab. The first code cell installs PyTrends, TrendSpy and pandas.
  2. Enter up to five keywords, a timeframe and a location.
  3. Run keyword suggestions to find the right topic entity for each term, then interest over time, hourly interest or the stitched long daily series.
  4. Run interest by region, related queries and related topics.
  5. Check today’s trending searches through TrendSpy and the official Trending now RSS feed.
  6. Export everything to CSV.

What you get

  • Relative interest (0 to 100) over time with a chart, plus each keyword’s share of search
  • Country, region, city and DMA breakdowns
  • Top and rising related queries and topics in one tidy table, with entity mids
  • Workarounds for topic versus search term, and for comparing more than five keywords with an anchor term
  • A status table showing which PyTrends methods work, which return errors and which were removed

Limits

These are undocumented endpoints with no published quota. Related queries in particular hit HTTP 429 quickly, so the notebook pauses after every request, backs off on errors and falls back to TrendSpy. If you are still blocked, wait a while or restart the Colab runtime. Trends data is always relative: it shows shape and share, and has no absolute search volumes.

Google announced an official Google Trends API in alpha in July 2025, with access by application. If you get access, it is the more stable route for regular reporting.

The full guide is The Ultimate Guide to PyTrends. To build trends and other data sources into a semantic keyword universe, see Semantic AI-powered SEO Keyword Research.

What’s included

  • Every PyTrends method that still works, tested in October 2026
  • Related queries with retries, back-off and a TrendSpy fallback when Google returns 429
  • Share of search, long daily series and hourly interest
  • Top and rising queries and topics in one tidy table, with entity mids
  • No API key; CSV exports