Skip to main content

Python client for the Trends MCP API. Keyword trend time series and growth rates across Google Search, YouTube, Reddit, Amazon, TikTok, Wikipedia, npm, Steam, and more.

Project description

trendsmcp

Python client for the Trends MCP API. Get live keyword trend data across 13 platforms: Google Search, YouTube, Reddit, Amazon, TikTok, Wikipedia, npm, Steam, and more. One API key, one client, no scraping, no proxies, no 429 errors.

Powered by trendsmcp.ai.

Get a free API key - 100 requests/month, no credit card.

Full API docs

Works with Python 3.8 through 3.13.


Install

pip install trendsmcp

Connect

from trendsmcp import TrendsMcpClient

client = TrendsMcpClient(api_key="YOUR_API_KEY")

Get your key at trendsmcp.ai.


get_trends

Returns a weekly time series for a keyword (5 years by default). Pass data_mode="daily" for the last 30 days at daily granularity.

series = client.get_trends(source="google search", keyword="bitcoin")

print(series[0])
# TrendsDataPoint(date='2021-01-03', value=12, volume=None, keyword='bitcoin', source='google search')

print(series[-1])
# TrendsDataPoint(date='2026-03-23', value=47, volume=None, keyword='bitcoin', source='google search')

# Daily granularity
series = client.get_trends(source="youtube", keyword="bitcoin", data_mode="daily")

Parameters

Parameter Type Description
source str Data source (see full list below)
keyword str Keyword to look up
data_mode str "weekly" (default) or "daily"

Returns a list of TrendsDataPoint objects:

Field Type Description
date str ISO date string
value float Normalized value 0-100
volume float or None Absolute volume estimate where available
keyword str The keyword queried
source str The data source

get_growth

Returns period-over-period growth for a keyword. Pass preset strings or custom date pairs.

growth = client.get_growth(
    source="google search",
    keyword="nike",
    percent_growth=["3M", "12M", "YTD"],
)

print(growth.results[0])
# GrowthResult(period='3M', growth=14.5, direction='increase', ...)

for r in growth.results:
    print(f"{r.period}: {r.growth:+.1f}% ({r.direction})")

Growth presets: 7D 14D 30D 1M 2M 3M 6M 9M 12M 1Y 18M 24M 2Y 36M 3Y 48M 60M 5Y MTD QTD YTD

Custom date ranges:

from trendsmcp import TrendsMcpClient, CustomGrowthPeriod

growth = client.get_growth(
    source="amazon",
    keyword="air fryer",
    percent_growth=[
        CustomGrowthPeriod(name="holiday lift", recent="2025-12-31", baseline="2025-10-01")
    ],
)

Parameters

Parameter Type Description
source str Data source
keyword str Keyword to look up
percent_growth list List of preset strings or CustomGrowthPeriod objects
data_mode str "weekly" (default) or "daily"

get_top_trends

Returns today's live trending items from platform feeds. Omit type to get all feeds at once.

# Single feed
trending = client.get_top_trends(type="Google Trends", limit=10)
print(trending.data)
# [[1, 'tiger woods'], [2, 'miley cyrus'], ...]

# All feeds at once
all_trending = client.get_top_trends()

Available feeds: Google Trends YouTube TikTok Trending Hashtags Reddit Hot Posts Amazon Best Sellers Top Rated App Store Top Free App Store Top Paid Wikipedia Trending Spotify Top Podcasts X (Twitter)

Parameters

Parameter Type Description
type str Feed name (omit for all feeds)
limit int Max items per feed, up to 200 (default 50)

Async support

import asyncio
from trendsmcp import AsyncTrendsMcpClient

async def main():
    client = AsyncTrendsMcpClient(api_key="YOUR_API_KEY")

    # Run multiple platforms concurrently
    google, youtube, reddit = await asyncio.gather(
        client.get_trends(source="google search", keyword="AI"),
        client.get_trends(source="youtube", keyword="AI"),
        client.get_trends(source="reddit", keyword="AI"),
    )
    print(f"Google: {google[-1].value}  YouTube: {youtube[-1].value}  Reddit: {reddit[-1].value}")

asyncio.run(main())

All three methods (get_trends, get_growth, get_top_trends) have async equivalents on AsyncTrendsMcpClient.


Error handling

from trendsmcp import TrendsMcpClient, TrendsMcpError

client = TrendsMcpClient(api_key="YOUR_API_KEY")

try:
    series = client.get_trends(source="google search", keyword="bitcoin")
except TrendsMcpError as e:
    print(e.status)   # HTTP status code, e.g. 429
    print(e.code)     # Machine-readable code, e.g. "rate_limited"
    print(e.message)  # Human-readable message

Use with Pandas

import pandas as pd
from trendsmcp import TrendsMcpClient

client = TrendsMcpClient(api_key="YOUR_API_KEY")
series = client.get_trends(source="google search", keyword="bitcoin")
df = pd.DataFrame([vars(p) for p in series])
print(df.tail())

All 13 supported sources

source What it measures
"google search" Google Search volume
"google images" Google Images search volume
"google news" Google News search volume
"google shopping" Google Shopping purchase intent
"youtube" YouTube search volume
"tiktok" TikTok hashtag volume
"reddit" Reddit mention volume
"amazon" Amazon product search volume
"wikipedia" Wikipedia page views
"news volume" News article mention count
"news sentiment" News sentiment score
"npm" npm package weekly downloads
"steam" Steam concurrent player count

All values are normalized 0 to 100 so you can compare across platforms directly.


Why not pytrends?

pytrends scrapes Google and has been archived since 2023. It breaks regularly, returns 429 errors, requires proxies, and only covers Google Search with relative scores (0 to 100), no absolute volume.

trendsmcp is a managed REST API. No scraping, no 429s, no proxies required, 13 platforms, absolute volume estimates, and actively maintained.


Related packages

Platform-specific packages that expose the same client with a pre-set SOURCE constant:


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trendsmcp-1.0.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trendsmcp-1.0.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file trendsmcp-1.0.1.tar.gz.

File metadata

  • Download URL: trendsmcp-1.0.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trendsmcp-1.0.1.tar.gz
Algorithm Hash digest
SHA256 412a2a73dda345f035b4724773a41617de4b0aa8770a33a0e8d4f7366dd2faa8
MD5 ea6ae22e52634b86d2bb10fab7809f84
BLAKE2b-256 888e650a9c944cc45b1fb109cfc43f3016952177d8d4082b47f5a464de953749

See more details on using hashes here.

Provenance

The following attestation bundles were made for trendsmcp-1.0.1.tar.gz:

Publisher: publish.yml on trendsmcp/trendsmcp-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trendsmcp-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: trendsmcp-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trendsmcp-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d9f1aa2e564cfa890bd1b10ce4c5c5728386cbdaa4d277d54cc619f1272a0bb
MD5 9906409f2b5febe605b8437d30545156
BLAKE2b-256 4617699ce1847dd4b9451c616474367a68fccb1d6fe3992b9f85e71e9e1a3537

See more details on using hashes here.

Provenance

The following attestation bundles were made for trendsmcp-1.0.1-py3-none-any.whl:

Publisher: publish.yml on trendsmcp/trendsmcp-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page