Disclosure: I built the Apify Actor in the last section, so I'm biased. Apify links here are referral links. The free method below doesn't need it.
You want one chart of nine databases, ten competitors or twenty product names on Google Trends. Trends only compares a handful of terms at once, and if you fetch two batches separately you can't just paste them side by side: each batch is scaled so that its own biggest value is 100.
The fix is old and simple: put one shared anchor term in every batch, then rescale every batch so the anchor matches. Below is a working Python version, a check that it gives the same answer as a direct comparison, the gotchas, and a hosted option at the end.
Why there's a limit, and why batches don't line up
- How many terms. Google's help page says the new Explore page lets you "compare up to 8 groups of terms at once", and that classic Explore "supports comparing 5 groups". The JSON endpoint pytrends calls (
trends.google.com/trends/api/explore) still behaves like classic Explore. On 25 November 2026 a request with 5 terms worked and one with 6 or 8 terms came back as HTTP 400. So from code, five is the real limit. If you only need 6 to 8 terms once, the website itself may be the quickest route. - Why the numbers are relative. From Google's Trends FAQ: each data point is divided by the total searches for that place and time, then "scaled on a range of 0 to 100". In one request, 100 is the single highest point among the terms in that request. Put the same keyword in two requests with different neighbours and you get two different sets of numbers. In the run below,
mongodbaveraged 19.7 (peak 63) in the batch with PostgreSQL and MySQL, and 13.2 (peak 42) in the batch with Supabase and Firebase: same searches, different scale.
So two batches of five are on two different scales. A term they share is how you convert one scale to the other.
The free way: anchor term + pytrends
pytrends is archived on GitHub (latest PyPI release 4.9.2), but on 25 November 2026 it still returned interest-over-time data for small jobs like this one. Each request is: the anchor plus up to 4 new terms. Every batch after the first is multiplied by anchor total in batch 1 / anchor total in this batch, and at the end the whole table is rescaled so the largest value is 100 again.
pip install pytrends pandas Save this as compare_many.py:
import time import pandas as pd from pytrends.request import TrendReq from pytrends.exceptions import TooManyRequestsError ANCHOR = "mongodb" TERMS = ["postgresql", "mysql", "sqlite", "redis", "supabase", "firebase", "dynamodb", "elasticsearch"] GEO, TIMEFRAME = "US", "today 12-m" def batches(terms, anchor, size=4): """Anchor + up to 4 new terms = 5, the most one request accepts.""" for i in range(0, len(terms), size): yield [anchor] + terms[i:i + size] def fetch(pytrends, kws, tries=4): for attempt in range(tries): try: pytrends.build_payload(kws, timeframe=TIMEFRAME, geo=GEO) df = pytrends.interest_over_time() break except TooManyRequestsError: if attempt == tries - 1: raise wait = 60 * (attempt + 1) print(f"429 from Google, waiting {wait}s") time.sleep(wait) if df.empty: raise RuntimeError(f"No data for {kws}") # the last point is often an unfinished week; drop it in every batch return df[~df["isPartial"]].drop(columns="isPartial") def stitch(frames, anchor): ref = frames[0][anchor].sum() parts = [frames[0][[anchor]]] for df in frames: if df[anchor].max() < 10: print(f"warning: anchor peaks at {df[anchor].max()} in {list(df.columns)}; " "pick a bigger anchor, rounding will distort this batch") factor = ref / df[anchor].sum() # puts this batch on batch 1's scale parts.append(df.drop(columns=anchor) * factor) merged = pd.concat(parts, axis=1) return merged / merged.max().max() * 100 # biggest value overall = 100 if __name__ == "__main__": pytrends = TrendReq(hl="en-US", tz=0) frames = [] for kws in batches(TERMS, ANCHOR): frames.append(fetch(pytrends, kws)) print("fetched", kws) time.sleep(2) result = stitch(frames, ANCHOR).round(1) result.to_csv("trends_stitched.csv") print(result.mean().sort_values(ascending=False).round(1).to_string()) Output from my run (US, past 12 months, average of the weekly values; 100 = the highest single week of any term):
fetched ['mongodb', 'postgresql', 'mysql', 'sqlite', 'redis'] fetched ['mongodb', 'supabase', 'firebase', 'dynamodb', 'elasticsearch'] postgresql 23.0 mysql 22.1 supabase 18.9 mongodb 13.2 firebase 10.6 redis 9.9 sqlite 7.7 elasticsearch 4.2 dynamodb 3.2 trends_stitched.csv has one column per term and one row per week, all on the same scale, ready for a chart. Nine terms took two requests. Each extra request adds 4 terms.
I used the sum of the anchor over the whole period, not one week, to work out the factor. Trends values are whole numbers, so any single week has rounding error; the total over the whole year evens most of that out.
Check that the stitching is right
You can test it: pick terms from different batches, ask Google for them in one direct request, and compare the ratios.
import pandas as pd from pytrends.request import TrendReq from compare_many import fetch stitched = pd.read_csv("trends_stitched.csv", index_col=0) mix = ["postgresql", "supabase", "sqlite", "dynamodb"] # from both batches direct = fetch(TrendReq(hl="en-US", tz=0), mix) for name, df in (("stitched", stitched[mix]), ("direct", direct[mix])): avg = df.mean() print(name.ljust(9), (avg / avg["postgresql"]).round(2).to_dict()) stitched {'postgresql': 1.0, 'supabase': 0.82, 'sqlite': 0.33, 'dynamodb': 0.14} direct {'postgresql': 1.0, 'supabase': 0.82, 'sqlite': 0.33, 'dynamodb': 0.14} Supabase and DynamoDB were never in a request with PostgreSQL or SQLite before this check, yet the stitched ratios match the direct request to two decimals. Do this check once whenever you change the anchor or the term list.
Gotchas
- Pick an anchor in the middle. If the anchor is tiny next to a big term, Google rounds it to 0, 1 or 2 in that batch and the factor becomes guesswork. If it's far bigger than everything, the other terms get squashed to 0 or 1. The script warns when the anchor's peak in a batch is below 10. I picked
mongodbbecause it sits in the middle of this list. - Same settings in every batch. Geo, timeframe, category and search type (
gprop) all change the scale. Mixing them breaks the maths without raising an error. - Fetch all batches in one go.
today 12-mis relative to the day you run it, so batches from different days can cover different weeks. The FAQ also says Google uses a sample of searches and adds "small and random fluctuations" (most visible on low-volume terms). In my test, the same 5-term request run 30 seconds apart gave identical numbers. But don't mix today's batch with last week's. - Drop the partial point. The last week is usually still in progress (
isPartialis true). The script drops it from every batch so it doesn't skew the anchor totals. - 429s. More batches means more requests. My first run of this script today got a 429 on its very first batch (from a cloud server, a few minutes after some test requests), which is why
fetch()waits and retries. For 50 terms (13 requests) or a server IP that Google already throttles, see pytrends 429 TooManyRequestsError: why it happens and 3 ways to fix it. - Zero means "too little data", not "nobody searched". The FAQ says low-volume terms appear as 0. Stitching can't recover them.
Hosted option: the same stitching on Apify
If pytrends keeps getting blocked where your code runs, my Google Trends Scraper Actor on Apify accepts several comparison lines in one run (comparisonGroups, terms separated by |). Each line comes back as one row with a values map per week, all on that line's own 0–100 scale. It does not stitch for you. You still need the anchor in every line and the same stitch() function. It also keeps only the first 5 terms of each line, so stick to the anchor plus 4.
This reuses the functions from compare_many.py (same folder):
import os import pandas as pd from apify_client import ApifyClient from compare_many import ANCHOR, TERMS, GEO, TIMEFRAME, batches, stitch groups = [list(b) for b in batches(TERMS, ANCHOR)] client = ApifyClient(os.environ["APIFY_TOKEN"]) run = client.actor("logicbase_systems/google-trends").call(run_input={ "comparisonGroups": [" | ".join(g) for g in groups], "geos": [GEO], "timeframe": TIMEFRAME, "includeRelatedQueries": False, "includeInterestByRegion": False, }) rows = {tuple(r["keywords"]): r for r in client.dataset(run.default_dataset_id).iterate_items() if r.get("status") == "ok"} frames = [] for g in groups: # keep the batch order: batch 1 is the reference points = [p for p in rows[tuple(g)]["interestOverTime"] if not p.get("isPartial")] frames.append(pd.DataFrame([p["values"] for p in points], index=[p["date"][:10] for p in points])) result = stitch(frames, ANCHOR).round(1) print(result.mean().sort_values(ascending=False).round(1).to_string()) pip install apify-client export APIFY_TOKEN="your-token" # Apify Console → Settings → API & Integrations My test run (25 November 2026, US, past 12 months) took about 4 seconds on the platform, returned both rows and printed the same ranking as the pytrends run. Every average was within 0.1 of it (postgresql 23.1 vs 23.0, redis 10.0 vs 9.9, the rest identical).
Pricing, from the Actor's live pricing today: $0.003 per keyword in a comparison (on the Free and Bronze plans), plus $0.00005 per run start. Two lines of 5 terms = 10 keyword results = $0.03. The anchor is charged once per line, so 9 terms cost 10 results here, and 50 terms (the anchor plus 49 others, so 13 lines) would cost 62 results, about $0.19. Rows with no data or an error are not charged. A new Apify account includes free monthly platform credit (check the current amount on Apify's pricing page).
If you want single-keyword series, related queries or regions without comparing anything, the walkthrough is in How to get Google Trends data in Python without an official API.
Quick recap
- From code, one Trends request compares at most 5 terms (6 gave HTTP 400 today). The new website allows up to 8.
- Put one mid-sized anchor term in every batch and rescale by the anchor's total.
- Check it once with a direct request that mixes terms from different batches.
- Same geo, timeframe and category in every batch, all fetched in the same session.
