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.
Metadata
Release files for trendsapi 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| trendsapi-1.0.0.tar.gz | 8.6 kB | Without provenance | Details for trendsapi-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| trendsapi-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for trendsapi-1.0.0-py3-none-any.whl |
Total release size: 18.2 kB
Release files / trendsapi-1.0.0.tar.gz
| Download URL | trendsapi-1.0.0.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b906a80da6a2a4bf19beb3a17f6661a095e9527d0623ef6e0711bd23c3200e53
|
|
BLAKE2b-256 checksum How to use checksums |
dd6f5adf9bf065307757d519d1cb22641d93c2582f9bebe84a9dbda83c2f2c77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / trendsapi-1.0.0-py3-none-any.whl
| Download URL | trendsapi-1.0.0-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54f85ce5319bdad65fba15d56c2b7fef44870207f866b86c9d8b8ef80480b673
|
|
BLAKE2b-256 checksum How to use checksums |
03dc61a10af1fbf4c1d4394bf926168fe2954ea8c54f1452f47de6147f05f183
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for trendsapi 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.