What TikTok Trends API does
TikTok Trends API MCP server connects agent workflows to the Trends API endpoint at https://api.trendsapi.ai/api. Its supported data operations cover three main needs: retrieving a time series for a hashtag or topic, calculating growth across one or more periods, and reading live TikTok trend feeds.
Historical results include dates and a 0–100 value for the requested series. When available, the response also includes absolute volume, the keyword, and a source or data-type label. The value is an indexed demand measure for that series, not a TikTok view count.
Growth responses can use standard windows such as 7D, 30D, 3M, 12M, YTD, or 5Y, as well as custom recent and baseline dates. Live responses include a snapshot timestamp, feed type, pagination fields, and ranked [rank, label] rows.
How it works
Requests use the Trends API’s HTTP contract. Historical calls set source to lowercase tiktok and select either get_time_series or get_growth. Live calls use get_top_trends and an exact feed name such as TikTok Trending Hashtags, TikTok Trending Searches, or TikTok Shop Hot Products.
The Python package returns dataclasses and response objects, while the JavaScript package returns equivalent object fields. Python applications can use TrendsAPI or AsyncTrendsAPI; JavaScript and TypeScript applications use TrendsAPI. Several growth windows can be requested in one call, and each successful request counts as one billed request.
Incorrect source or feed spelling produces a 400 error. A 404 means no series exists for the keyword and should not be retried. Authentication failures return 401, quota exhaustion returns 429, and client retries 5xx responses before raising an error.
Setup and configuration
TikTok Trends API MCP server requires a key from trendsapi.ai, supplied through the TRENDSAPI_KEY environment variable or directly to the client constructor. Python requires version 3.9 or newer and installs with pip install trendsapi-tiktok. JavaScript or TypeScript projects install trendsapi-tiktok with npm and require Node 18 or newer; Deno, Bun, and Workers are also listed as supported runtimes.
Raw HTTP callers send a bearer token in the Authorization header and JSON to the API endpoint. SDKs decode the response body automatically. With raw curl, the HTTP body field may itself contain a JSON string that needs a second parse.
Tools and capabilities
- Retrieve historical hashtag or topic time series.
- Calculate growth for preset or custom date ranges.
- Read live TikTok trending hashtags, searches, and Shop hot-product feeds.
- Paginate live results with
limit and offset.
- Run asynchronous requests in Python.
- Convert time-series dataclasses into pandas data for resampling and analysis.
Limitations and notes
TikTok Trends API MCP server measures demand and search interest; it is not a publishing interface. Posting videos still requires TikTok’s own APIs. The optional # is accepted for keyword input, while the TikTok source must be written as lowercase tiktok. Live-feed type names are case-sensitive.
The time-series value is normalized from 0 to 100 for the selected series. Absolute volume may not be present. The live endpoint supports category only for the documented Amazon Best Sellers by Category and Top Websites feeds, so it should not be assumed to filter TikTok feeds. Quota and billing behavior should be considered when making repeated or asynchronous requests.