Disclosure: I build and maintain the Apify Actor used in this tutorial ( ocius-data/google-trends-reliable ). The method for comparing more than five terms works with any tool; the code below uses ours.
Google has never shipped a public Google Trends API. Most Python projects use pytrends , an unofficial library that calls the same endpoints as the website. It works well in a notebook and then breaks in production for two reasons:
TooManyRequestsError (HTTP 429). Google rate-limits by IP address. A scheduled job on a cloud server hits the limit after a few requests, and the usual fix ( time.sleep plus retries) makes every run slow and still unreliable.
The five-term limit. Google Trends compares at most five terms per request, and every request is scaled to its own 0-100 range.…