Trends API - official Python client
One score. Every platform. Official Python client for the Trends API - Google, TikTok, Amazon, Reddit, YouTube, Steam, npm and 30+ sources normalized to a single 0-100 trend score.
Get a free API key → · Quickstart → · llms.txt →
Why Trends API (not scrapers, not a SERP swiss-army knife)
| # | Selling point | What that means for you |
|---|---|---|
| 1 | Managed, not scraped | Stable JSON. No browser automation, no proxy pool, no Google/TikTok anti-bot 429 babysitting. |
| 2 | 30+ sources, one key, one schema | 15 keyword sources + 21 live feeds. Swap source / type - response shape stays the same. |
| 3 | Normalized 0-100 across platforms | Compare TikTok vs Amazon vs Google on the same scale. No unit gymnastics. |
| 4 | History + growth + live top trends | Three modes: time series, period growth (3M / 12M / 5Y), and “what’s hot now” feeds. |
| 5 | Built for agents | Hosted MCP + llms.txt. Same key as the REST API. |
Also: failed requests do not burn quota - only successful 200s count. Plan limits are predictable; you are not fighting upstream rate limits to get a single series.
Replacing archived pytrends? Same job (Google interest over time), without the breakage - and you also get TikTok, Amazon, Reddit, YouTube, live feeds, and growth windows.
Install
pip install trendsapi
Python 3.9+. Only dependency: httpx.
Quickstart
Cross-platform compare in a few lines:
from trendsapi import TrendsAPI
client = TrendsAPI(api_key="YOUR_API_KEY") # or export TRENDSAPI_KEY=...
keyword = "creatine gummies"
# 1) Growth on three platforms - same keyword, comparable scores
for source in ("google search", "tiktok", "amazon"):
g = client.get_growth(source=source, keyword=keyword, percent_growth=["12M"])
r = g.results[0]
print(source, r.growth, r.direction)
# 2) ~5 years of weekly history
series = client.get_time_series(source="google search", keyword=keyword)
print("latest", series[-1].date, series[-1].value)
# 3) What’s trending right now (no keyword)
hot = client.get_top_trends(type="TikTok Trending Hashtags", limit=5)
print(hot.data)
Async (fan out sources)
import asyncio
from trendsapi import AsyncTrendsAPI
async def main():
client = AsyncTrendsAPI() # reads TRENDSAPI_KEY
google, tiktok, amazon = await asyncio.gather(
client.get_time_series(source="google search", keyword="air fryer"),
client.get_time_series(source="tiktok", keyword="air fryer"),
client.get_time_series(source="amazon", keyword="air fryer"),
)
print(len(google), len(tiktok), len(amazon))
asyncio.run(main())
Auth & quota
- Free key in ~60 seconds: trendsapi.ai/#get-key (100 requests/month).
- Pass
TrendsAPI(api_key=...)or setTRENDSAPI_KEY. - Only successful
200responses count. 4xx/5xx are free. - Plan tiers scale when you need more volume - see pricing.
This is the opposite of scraper life: you don’t burn hours on IP bans; you burn a clear monthly lookup budget.
Three modes
| Method | Use when you need | Notes |
|---|---|---|
get_time_series |
History / charts | Default ~5y weekly; data_mode="daily" for recent daily |
get_growth |
Momentum | Presets like 3M, 12M, 5Y, YTD; multi-period in one call |
get_top_trends |
Live leaderboards | No keyword. TikTok hashtags, Google Trends, Amazon best sellers, … |
Full source and feed lists: trendsapi.ai/llms.txt
Keyword sources
google search · google images · google news · google shopping · youtube · tiktok · reddit · amazon · wikipedia · news volume · news sentiment · app downloads · app rankings · npm · steam
from trendsapi import KEYWORD_SOURCES, LIVE_FEEDS
MCP (Claude, Cursor, VS Code, ChatGPT)
{
"mcpServers": {
"trendsapi": {
"url": "https://api.trendsapi.ai/mcp",
"transport": "http",
"headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
}
}
Then ask: “Compare 12-month growth of creatine gummies on Google, TikTok, and Amazon.”
Errors
from trendsapi import TrendsAPI, TrendsAPIError
try:
TrendsAPI(api_key="bad").get_growth(source="google search", keyword="x")
except TrendsAPIError as e:
print(e.status, e.code, e.message)
If a growth preset is longer than available history for that keyword (common on new TikTok tags), the API may still return HTTP 200 with a per-row status="error". Those rows parse with growth=None and error / message set.
Links
- Product: https://trendsapi.ai
- Quickstart: https://trendsapi.ai/#quickstart
- API for agents: https://trendsapi.ai/llms.txt
- All sources: https://trendsapi.ai/trends
- GitHub: https://github.com/trendsapi/trendsapi-py
License
MIT. Data access follows your Trends API plan limits.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trendsapi-1.0.0.tar.gz.
File metadata
- Download URL: trendsapi-1.0.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b906a80da6a2a4bf19beb3a17f6661a095e9527d0623ef6e0711bd23c3200e53
|
|
| MD5 |
a6b2cdacc01eed4c9fd2c3563fb7e359
|
|
| BLAKE2b-256 |
dd6f5adf9bf065307757d519d1cb22641d93c2582f9bebe84a9dbda83c2f2c77
|
File details
Details for the file trendsapi-1.0.0-py3-none-any.whl.
File metadata
- Download URL: trendsapi-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54f85ce5319bdad65fba15d56c2b7fef44870207f866b86c9d8b8ef80480b673
|
|
| MD5 |
b98e54ba4622b5f67b9f45518e54aea2
|
|
| BLAKE2b-256 |
03dc61a10af1fbf4c1d4394bf926168fe2954ea8c54f1452f47de6147f05f183
|