JSON API

Data Source

A data source plugin for loading JSON APIs into Grafana.
  • JSON API
    JSON API
  • Query variable
    Query variable

JSON API data source for Grafana

Build Release Marketplace Downloads License

A data source plugin for loading JSON APIs into Grafana.

Screenshot

Extract one or more values from a JSON API using JSON Path. Each path results in a field in the query result. All fields need to be of the same length.

Configuration

This section lists the available configuration options for the JSON API data source.

Query editor

ConfigurationDescription
PathAppends a URL path to the URL configured by the data source.
Query stringOverrides the custom query parameters configured by the data source.
Cache TimeDetermines the time in seconds to save the API response.
QueryDefines the JSON Path used to extract the field.
TypeDefines the type of the values returned by the JSON Path query.

Variables

Variables are supported for all text configuration options.

Macros

Use macros in your query string and JSON Path queries to add dashboard context to your queries. Macros are available for the Query string and (JSON Path) Query options.

MacroDescription
$__unixEpochFrom()Start of the dashboard time interval as a Unix timestamp, i.e. 1494410783
$__unixEpochTo()End of the dashboard time interval as a Unix timestamp, i.e. 1494410783

Public data sets

Here are a few publicly available JSON data sets that you can try out.

Reddit

Get information about any subreddit by adding .json at the end of the URL.

Configuration

  • URL: https://www.reddit.com/r/grafana.json

Sample queries

  • $.data.children[*].data.title
  • $.data.children[*].data.created_utc
  • $.data.children[*].data.ups

TVmaze

List episodes from your favorite TV series.

Configuration

  • URL: http://api.tvmaze.com/singlesearch/shows
  • Query string: q=archer&embed=episodes

Sample queries

  • $._embedded.episodes[*].name
  • $._embedded.episodes[*].airstamp
  • $._embedded.episodes[*].season
  • $._embedded.episodes[*].number
Sign up Now

Version

Dependencies:
  • Grafana 7.3.x