Ship trend charts in product UI with one API shape

Product and data teams call the same JSON contract from Retool, internal admin panels, and agent workflows so customer-facing trend views stay consistent.

Embedded analytics succeeds when the backend delivers predictable JSON instead of screen scraping glue code. Trends MCP exposes keyword trends, growth summaries, and ranked feeds through POST bodies so chart layers stay boring on purpose.

Why embedded trend widgets stall without a shared contract

Teams often inherit three vendor APIs that disagree on units and timestamps. The UI code forks into special cases. Alerts drift out of sync with what users see.

A single API shape reduces branching in visualization layers. Arrays with ISO dates and normalized scores map cleanly to chart frameworks.

What to call from the REST surface

Requests target POST https://api.trendsmcp.ai/api with Authorization set to Bearer plus your key from account setup.

get_trends loads long-range weekly series by default for sources such as google search, youtube, tiktok hashtags, amazon search volume, npm downloads, or steam players. Optional data_mode daily appears on REST for recent Google sources when daily granularity matters.

get_growth accepts arrays such as 7D, 30D, 90D, YTD, and 12M so comparison tiles stay aligned with finance or marketing language.

get_top_trends lists ranked feeds when the UI needs leaderboards such as Google Trends, YouTube Trending, App Store Top Free, or GitHub Trending Repos.

Where MCP fits alongside REST

Developers using Cursor, Claude Code, or VS Code often wire MCP for exploratory pulls during schema design. Production traffic still benefits from explicit REST calls where observability and retries already exist.

Reference wiring patterns on the GitHub Copilot MCP setup page when pairing IDE assistants with the same project repository.

Practical embedding checklist

Store keyword spelling exactly as the upstream expects. TikTok expects hashtags or topics suitable for hashtag volume. Reddit expects subreddit names without the prefix. Wikipedia expects article titles that resolve cleanly.

Handle empty states when data_unavailable appears and surface a retry path rather than hard zeros.

For usage accounting, treat each get_trends request as one source plus one keyword. Each get_growth request stays one source plus one keyword even when multiple percent_growth entries appear in the payload.

How Python services typically wrap calls

Internal services often centralize HTTP calls in one module, then expose typed methods to front ends. The dedicated guide at python trends API patterns walks through httpx friendly usage.

Related architecture notes

Teams comparing stream versus batch stacks should read headless trends API planning. Operators stitching multiple vendors should review API orchestration for trend data.

Common questions

Use get_trends for historical lines when the widget charts interest over time. Use get_growth when the widget compares recent versus baseline periods. Use get_top_trends when the widget shows ranked lists such as Google Trends or TikTok Trending Hashtags.
Cache by keyword, source, and operation. Respect freshness expectations from product managers because weekly series already aggregates noise into manageable buckets.
Yes. Point automation agents at the MCP endpoint while production workers post JSON bodies to the REST host; align parsing logic around the same fields documented at trendsmcp.ai/docs.