{"components":{"schemas":{"Error":{"description":"Parsed error body. The REST transport is always HTTP 200; the real outcome is in the payload envelope {\"statusCode\": <int>, \"body\": <json string>}. A non-2xx statusCode means body parses to this schema.","properties":{"error":{"enum":["missing_parameter","invalid_source","invalid_mode","invalid_request","no_data","source_unavailable","growth_calculation_failed","internal_error"],"type":"string"},"message":{"type":"string"},"request_id":{"description":"Present on internal_error; quote it when contacting support.","type":"string"}},"type":"object"},"GetGrowthRequest":{"properties":{"keyword":{"description":"What to look up. The string format is required by source. Standard sources: any name or phrase, e.g. 'nike'. npm: exact npmjs.com package name, case-sensitive ('react', '@babel/core'). python: exact PyPI project name ('pandas', 'requests'). steam: game display name in plain English, not a Steam App ID ('Elden Ring'). app downloads and app rankings: Android bundle ID only, the id= value on Google Play ('com.openai.chatgpt'), not an app name or iOS App Store ID.","type":"string"},"mode":{"const":"get_growth","description":"Canonical name (matches the MCP tool). Alias: 'growth'.","type":"string"},"percent_growth":{"default":["12M"],"description":"Growth windows. Each item is a window string or, on REST only, a custom date-range object. Every window is a two-date comparison. `window` is accepted as a REST alias.","items":{"oneOf":[{"description":"Any whole number plus a D, W, M, or Y suffix, up to 5 years (e.g. '7D', '17D', '45D', '3M', '18M', '2Y'), or MTD, QTD, YTD. Common presets: 7D, 1W, 14D, 2W, 30D, 1M, 2M, 3M, 6M, 9M, 12M, 1Y, 18M, 24M, 2Y, 36M, 3Y, 48M, 4Y, 60M, 5Y, MTD, QTD, YTD.","type":"string"},{"description":"Custom date range. REST only; MCP accepts the string windows.","properties":{"baseline":{"format":"date","type":"string"},"name":{"description":"Optional label.","type":"string"},"recent":{"format":"date","type":"string"}},"required":["recent","baseline"],"type":"object"}]},"type":"array"},"source":{"description":"One source, or comma-separated sources for get_growth (e.g. 'amazon, tiktok, youtube'). get_time_series takes exactly one.","enum":["google search","google images","google news","google shopping","youtube","tiktok","reddit","amazon","wikipedia","news volume","news sentiment","app downloads","app rankings","npm","steam","python"],"type":"string"}},"required":["mode","source","keyword"],"type":"object"},"GetTimeSeriesRequest":{"properties":{"keyword":{"description":"What to look up. The string format is required by source. Standard sources: any name or phrase, e.g. 'nike'. npm: exact npmjs.com package name, case-sensitive ('react', '@babel/core'). python: exact PyPI project name ('pandas', 'requests'). steam: game display name in plain English, not a Steam App ID ('Elden Ring'). app downloads and app rankings: Android bundle ID only, the id= value on Google Play ('com.openai.chatgpt'), not an app name or iOS App Store ID.","type":"string"},"mode":{"const":"get_time_series","description":"Canonical name (matches the MCP tool). Aliases: 'get_trends', 'trends', 'time_series', 'lookup'.","type":"string"},"source":{"description":"Exactly one source per request.","enum":["google search","google images","google news","google shopping","youtube","tiktok","reddit","amazon","wikipedia","news volume","news sentiment","app downloads","app rankings","npm","steam","python"],"type":"string"}},"required":["mode","source","keyword"],"type":"object"},"GetTopTrendsRequest":{"properties":{"category":{"description":"Required when type is one of: Google Trends by Category, TikTok Trending Hashtags by Category, Amazon Best Sellers by Category, Top Websites, Substack by Category. Use the official category name (case-insensitive).","type":"string"},"limit":{"default":25,"description":"Max rows to return. Free plan boards return the top 10 only.","maximum":200,"minimum":1,"type":"integer"},"mode":{"const":"get_top_trends","description":"Canonical name (matches the MCP tool). Alias: 'top_trends'.","type":"string"},"offset":{"default":0,"description":"Rows to skip for pagination. Pinned to 0 on the Free plan; pagination is a paid feature.","minimum":0,"type":"integer"},"sort":{"default":"rank","description":"'rank': current leaders. 'rank_change': biggest climbers vs a prior snapshot (rows include prev_rank and rank_change).","enum":["rank","rank_change"],"type":"string"},"type":{"description":"One live feed. Required on both REST and MCP; omitting it returns a 400 missing_parameter error.","enum":["Google Trends","Google Trends by Category","Google News Top News","TikTok Trending Hashtags","TikTok Trending Hashtags by Category","TikTok Trending Searches","YouTube Trending","X (Twitter) Trending","Reddit Hot Posts","Reddit World News","Wikipedia Trending","Amazon Best Sellers Top Rated","Amazon Best Sellers by Category","App Store Top Free","App Store Top Paid","Google Play","Top Websites","Spotify Top Podcasts","Steam Most Played","Substack","Substack by Category","GitHub","IMDb MOVIEmeter","Open Library Trending Books"],"type":"string"},"window":{"default":"30d","description":"Lookback used only when sort is 'rank_change'. Short windows only have baselines on daily feeds.","enum":["1d","3d","7d","14d","30d"],"type":"string"}},"required":["mode","type"],"type":"object"},"GrowthResponse":{"properties":{"data_source":{"type":"string"},"metadata":{"properties":{"all_successful":{"type":"boolean"},"calculations_completed":{"type":"integer"},"total_data_points":{"type":"integer"}},"type":"object"},"results":{"items":{"$ref":"#/components/schemas/GrowthResult"},"type":"array"},"search_term":{"type":"string"}},"type":"object"},"GrowthResult":{"properties":{"baseline_date":{"format":"date","type":"string"},"baseline_value":{"type":"number"},"baseline_volume":{"type":["number","null"]},"direction":{"description":"'increase' or 'decrease'.","type":"string"},"growth":{"description":"Percentage change, e.g. -12.31.","type":"number"},"period":{"type":"string"},"recent_date":{"format":"date","type":"string"},"recent_value":{"type":"number"},"recent_volume":{"type":["number","null"]},"volume_available":{"type":"boolean"},"volume_growth":{"type":["number","null"]}},"type":"object"},"TimeSeriesPoint":{"properties":{"date":{"format":"date","type":"string"},"keyword":{"type":"string"},"source":{"type":"string"},"value":{"description":"Trend score on a 0-100 index.","maximum":100,"minimum":0,"type":"number"},"volume":{"description":"Absolute volume where available.","type":["number","null"]}},"type":"object"},"TimeSeriesResponse":{"description":"~5 years of weekly data points, oldest to newest.","items":{"$ref":"#/components/schemas/TimeSeriesPoint"},"type":"array"},"TopTrendsResponse":{"properties":{"as_of_ts":{"format":"date-time","type":"string"},"baseline_ts":{"description":"Present only when sort is 'rank_change'.","format":"date-time","type":"string"},"category":{"type":"string"},"count":{"type":"integer"},"data":{"items":{"oneOf":[{"description":"[rank, keyword] for sort='rank'.","prefixItems":[{"description":"Current rank.","type":"integer"},{"description":"Keyword or item name.","type":"string"}],"type":"array"},{"description":"Mover row for sort='rank_change'.","properties":{"category_path":{"type":"string"},"keyword":{"type":"string"},"prev_rank":{"type":"integer"},"rank":{"type":"integer"},"rank_change":{"description":"Positions climbed.","type":"integer"}},"type":"object"}]},"type":"array"},"limit":{"type":"integer"},"note":{"description":"Present when count is 0 to explain why and what to do next.","type":"string"},"sort":{"type":"string"},"type":{"type":"string"},"window":{"type":"string"}},"type":"object"}},"securitySchemes":{"bearerAuth":{"description":"API key (format `tapi_live_...`). Get one free at https://trendsapi.ai/#get-key","scheme":"bearer","type":"http"}}},"info":{"contact":{"email":"[email protected]","name":"Trends API Support","url":"https://trendsapi.ai"},"description":"One POST endpoint for trend data: historical time series, point-to-point growth windows, and live trending feeds across Google, YouTube, TikTok, Reddit, Amazon, Wikipedia, news, apps, npm, Steam and more. Scores use a 0-100 index with absolute volume where available. Pick the operation with the `mode` field in the JSON body. The same operations are also available as MCP tools at `https://api.trendsapi.ai/mcp`. Free API key (100 requests/month): https://trendsapi.ai/#get-key","license":{"name":"Terms of Service","url":"https://trendsapi.ai/terms"},"summary":"Live trend data across search, social, commerce, news, and developer platforms","title":"Trends API","version":"1.0.0","x-mcp-server":"https://api.trendsapi.ai/mcp"},"openapi":"3.1.0","paths":{"/api":{"post":{"description":"Run one of three operations, selected by the `mode` field: `get_time_series` (historical series for one source + keyword), `get_growth` (percentage change over one or more windows), `get_top_trends` (live ranked feeds, no keyword).","operationId":"queryTrends","requestBody":{"content":{"application/json":{"examples":{"growth":{"summary":"Growth over several windows","value":{"keyword":"nike","mode":"get_growth","percent_growth":["12M","3M","YTD"],"source":"google search"}},"movers":{"summary":"Biggest climbers in a category this week","value":{"category":"Toys Games","limit":10,"mode":"get_top_trends","sort":"rank_change","type":"Amazon Best Sellers by Category","window":"7d"}},"timeSeries":{"summary":"Weekly Google Search series for a keyword","value":{"keyword":"bitcoin","mode":"get_time_series","source":"google search"}},"topTrends":{"summary":"Live Google Trends board","value":{"limit":10,"mode":"get_top_trends","type":"Google Trends"}}},"schema":{"discriminator":{"mapping":{"get_growth":"#/components/schemas/GetGrowthRequest","get_time_series":"#/components/schemas/GetTimeSeriesRequest","get_top_trends":"#/components/schemas/GetTopTrendsRequest"},"propertyName":"mode"},"oneOf":[{"$ref":"#/components/schemas/GetTimeSeriesRequest"},{"$ref":"#/components/schemas/GetGrowthRequest"},{"$ref":"#/components/schemas/GetTopTrendsRequest"}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TimeSeriesResponse"},{"$ref":"#/components/schemas/GrowthResponse"},{"$ref":"#/components/schemas/TopTrendsResponse"}]}}},"description":"Always HTTP 200 at the transport level, including for errors. The payload is an envelope: {\"statusCode\": <int>, \"body\": <json string>}. A 2xx statusCode means success; parse `body` as one of the schemas below (shape depends on `mode`: an array of points for get_time_series, a growth report for get_growth, a ranked board for get_top_trends). Any other statusCode means `body` parses to the Error schema."}},"security":[{"bearerAuth":[]}],"summary":"Query trend data","tags":["trends"]}}},"security":[{"bearerAuth":[]}],"servers":[{"description":"Production","url":"https://api.trendsapi.ai"}],"tags":[{"description":"Trend data operations","name":"trends"}]}
