pytrends-alternative
v1.0.1
Published
Managed Google Trends client for JavaScript/TypeScript. History, growth, and 30+ other sources via the Trends API. The modern alternative to dead scraper packages.
Maintainers
Readme
pytrends alternative
pytrends is archived. Google blocks the endpoints it scraped. This package maps that workflow onto Trends API: three modes, not ten.
Key: trendsapi.ai/#get-key. Full contract: trendsapi-ai/trendsapi. General Google JSON: google-trends-api.
Install
npm install pytrends-alternativeimport { TrendsAPI } from "pytrends-alternative";
const client = new TrendsAPI({ apiKey: process.env.TRENDSAPI_KEY });
const series = await client.getTimeSeries("electric vehicle");
const growth = await client.getGrowth("electric vehicle", {
percent_growth: ["3M", "6M", "12M"],
});
const hot = await client.getTopTrends({ type: "Google Trends", limit: 20 });Keyword helpers default to source: "google search". Python: pip install trendsapi. Official full JS client: trendsapi.
Mapping
| pytrends | Trends API |
|---|---|
| TrendReq(...) + build_payload(...) | Not needed. One client call |
| interest_over_time() | getTimeSeries("term") or mode: get_time_series, source: google search |
| DataFrame pct_change | getGrowth("term", { percent_growth: ["3M","12M"] }) |
| trending_searches() | getTopTrends({ type: "Google Trends" }) |
| interest_by_region() | No equivalent |
| related_queries() / related_topics() | No equivalent |
| proxies=, cookies, User-Agent | Remove |
One keyword per request. Five terms in kw_list become five calls.
404 means no series for that spelling (same role as an empty pytrends frame). Do not retry 404s.
Indexes will not match an old pytrends CSV cell-for-cell. Compare shape and direction, not exact 0-100 values.
Site: trendsapi.ai/trends/pytrends-alternative.
License
MIT. See LICENSE.
