Grafana trend dashboard from a REST API

Grafana has no native Google Trends or TikTok connector. A JSON API datasource pointed at Trends MCP turns weekly search interest, growth percentages, and live leaderboard polls into time-series panels without scraping or per-platform API keys.

Operations teams already run Grafana for infrastructure metrics. Product and growth teams want the same wallboard for search demand, but Grafana's plugin catalog stops at Prometheus, InfluxDB, and cloud vendor metrics. Wiring trend data in means either a custom exporter or a REST datasource that returns time-indexed JSON.

Trends MCP exposes keyword time series, growth calculations, and live trending leaderboards through POST https://api.trendsmcp.ai/api. One Bearer token covers Google Search, TikTok, Reddit, Amazon, and the live feed catalog. This page walks through datasource setup, three panel types, and refresh intervals that stay inside monthly quotas.

For a platform-agnostic dashboard design primer, see how to build a trends dashboard. For a no-code alternative in spreadsheets, see Google Sheets trend dashboard.

Prerequisites

ItemDetail
Grafana instanceGrafana Cloud or self-hosted 9.x+
Datasource pluginJSON API (marcusolsson-json-datasource) or Infinity
Trends MCP API keyFree tier at 100 requests/month from trendsmcp.ai/account
Network egressGrafana must reach api.trendsmcp.ai over HTTPS

Store the API key in Grafana's secret management or an environment variable referenced in the datasource config. Do not embed keys in dashboard JSON exported to public repos.

Configure the JSON API datasource

Create a new datasource with these settings:

FieldValue
NameTrendsMCP
URLhttps://api.trendsmcp.ai/api
AccessServer (Grafana backend proxies the request)
MethodPOST
HTTP HeadersAuthorization: Bearer <API_KEY>
Content-Typeapplication/json

The datasource sends a static JSON body per query. Grafana's JSON API plugin maps response fields to time series using a JSONPath or field override.

Time series query body

{
  "mode": "get_time_series",
  "source": "google search",
  "keyword": "grafana"
}

Response shape (abbreviated):

[
  {"date": "2026-07-14", "value": 42, "volume": 125000, "keyword": "grafana", "source": "google search"},
  {"date": "2026-07-21", "value": 45, "volume": 132000, "keyword": "grafana", "source": "google search"}
]

In the JSON API query editor, set the root path to $[*] and map date to the time field and value to the metric. Enable "Convert to time series" if the plugin offers it. The normalized 0-100 value field plots cleanly; volume adds absolute search counts where the pipeline provides them.

Panel 1: Weekly search interest time series

Add a Time series panel sourced from the TrendsMCP datasource.

Panel settingRecommendation
TitleGoogle Search interest: [keyword]
Query body sourcegoogle search
Legend{{keyword}} or static label
Unitshort (0-100 scale)
Refresh24h or 7d (weekly data points)

Duplicate the panel for competitor keywords by cloning the query and changing the keyword field. Each clone costs one API request per refresh cycle.

Swap source to youtube, tiktok, or reddit for platform-specific panels. Reddit expects subreddit names without the r/ prefix.

Panel 2: Growth stat tiles

Growth panels call get_growth and display percentage change as stat or gauge visuals.

Query body:

{
  "mode": "get_growth",
  "source": "google search",
  "keyword": "observability",
  "percent_growth": ["3M", "12M", "YTD"]
}

Response includes a results array with period, growth, and direction fields. Configure three stat panels or one table panel:

Period fieldDisplay
3M3-month growth %
12M12-month growth %
YTDYear-to-date growth %

Set thresholds on the stat panel: green below 0% decline, yellow for flat (-5% to +5%), red for sharp drops. Growth direction comes from the API; no manual calculation is needed in Grafana transforms.

Panel 3: Live trending leaderboard table

Leaderboard panels poll get_top_trends for feeds that do not require a keyword.

Query body:

{
  "mode": "get_top_trends",
  "type": "Google Trends",
  "limit": 15
}

Response format:

{
  "as_of_ts": "2026-07-22T06:00:00Z",
  "type": "Google Trends",
  "count": 15,
  "data": [[1, "topic one"], [2, "topic two"], [3, "topic three"]]
}

Map data[*][0] to a Rank column and data[*][1] to a Topic column in a Table panel. Set dashboard refresh to 30m or 1h. Feed type strings are case-sensitive: Google Trends, X (Twitter), TikTok Trending Hashtags, Reddit Hot Posts.

Multi-source dashboard layout

A practical three-row layout covers discovery, history, and momentum:

RowPanel typeData modeRefresh
TopTableget_top_trends (Google Trends)30m
MiddleTime series × 3get_time_series (google search, youtube, tiktok)24h
BottomStat × 3get_growth (12M per keyword)24h

Total requests per full refresh: 1 (leaderboard) + 3 (time series) + 3 (growth) = 7. At one refresh per day, that is ~210 requests per month, above the free tier. Reduce to two keywords or refresh every 48 hours to stay near 100 requests.

Quota planning for production

Dashboard shapeRequests per refreshDaily refreshMonthly total
1 keyword time series11~30
3 keywords + 1 leaderboard41~120
5 keywords + growth + leaderboard111~330

Teams above the free tier upgrade to Starter or Pro plans at trendsmcp.ai/pricing. Cache responses in Grafana's query cache or an intermediate Redis layer if multiple viewers hit the same dashboard.

Alerting on trend thresholds

Grafana alert rules can fire when a growth stat crosses a threshold or when a new topic enters the leaderboard table. Two patterns work well:

  1. Growth alert: Stat panel on 12M growth drops below -20%. Evaluation interval 24h matches weekly data cadence.
  2. New topic alert: Table panel with a transformation that diffs current data against a Grafana constant or secondary query stored in a text panel. Simpler teams export leaderboard snapshots to webhook trend pipelines and let an external service handle diff logic.

Grafana cannot call MCP tool prompts directly. All panels use the REST API with explicit mode fields. For Python-based ETL before Grafana ingestion, see Python trends API.

Limits to plan around

Weekly time series panels show step changes on refresh day, not intra-week spikes. Live feeds reflect the current leaderboard at poll time; Grafana does not stream updates. Geographic filtering available in some Google Trends interfaces is not exposed on every Trends MCP source today. Panels should label the source and as_of_ts fields so viewers know which platform and timestamp the data represents.

Common questions

Grafana ships no built-in Google Trends datasource. Teams typically export CSV files manually, run a custom backend, or point a JSON API datasource at a third-party REST provider. Trends MCP exposes Google Search interest, TikTok volume, and 15 other keyword sources through one POST endpoint at api.trendsmcp.ai/api, which Grafana's JSON API or Infinity plugin can query.
The JSON API datasource plugin (marcusolsson-json-datasource) or the Infinity datasource both accept POST requests with custom headers. Configure Authorization: Bearer YOUR_API_KEY and POST a JSON body with mode, source, and keyword fields. Grafana transforms the returned date-value array into time series.
Keyword time series change weekly, so daily or weekly refresh is enough for historical panels. Live leaderboard panels via get_top_trends can refresh every 15 to 60 minutes depending on quota. The free Trends MCP tier allows 100 requests per month. A dashboard with three keyword panels refreshed daily uses about 90 requests per month.
No. Trends MCP normalizes Google Search, YouTube, TikTok, Reddit, Amazon, npm, and other sources behind one API key and one JSON response shape. Grafana panels pass different source values in the POST body. No Google Cloud project, TikTok developer account, or X API credentials are required for the datasource.