Related searches from Google Trends for up to 5 terms: the top and the rising related queries for each term, each with its value (relative interest from 0 to 100 for top queries; growth in % for rising ones, Breakout above +5000%) and a Trends link. Filter by region, period, category and search property (web, images, news, YouTube, shopping). A note says when Trends has too little data to list any.
Every response includes credits_used: the credits this call cost.
Parameters
name
type
description
qrequired
string
Search term, or up to 5 comma-separated terms. Example: coffee
geo
string
Country code (US) or region (US-CA); leave out for worldwide. Example: US
time
string
Period: now 1-H, now 4-H, now 1-d, now 7-d, today 1-m, today 3-m, today 12-m (default), today 5-y, all, or YYYY-MM-DD YYYY-MM-DD.
import os, requests
res = requests.get(
"https://api.api.sh/google-trends/v1/related",
params={"q": "coffee"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json()
const url = new URL("https://api.api.sh/google-trends/v1/related");
url.searchParams.set("q", "coffee");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json();
Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).
The fastest way to see the full response is the playground: it runs this endpoint with your account and shows the exact JSON.