A data source plugin for loading JSON APIs into Grafana.
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.
This section lists the available configuration options for the JSON API data source.
Configuration | Description |
---|---|
Path | Appends a URL path to the URL configured by the data source. |
Query string | Overrides the custom query parameters configured by the data source. |
Cache Time | Determines the time in seconds to save the API response. |
Query | Defines the JSON Path used to extract the field. |
Type | Defines the type of the values returned by the JSON Path query. |
Variables are supported for all text configuration options.
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.
Macro | Description |
---|---|
$__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 |
Here are a few publicly available JSON data sets that you can try out.
Get information about any subreddit by adding .json
at the end of the URL.
- URL:
https://www.reddit.com/r/grafana.json
$.data.children[*].data.title
$.data.children[*].data.created_utc
$.data.children[*].data.ups
List episodes from your favorite TV series.
- URL:
http://api.tvmaze.com/singlesearch/shows
- Query string:
q=archer&embed=episodes
$._embedded.episodes[*].name
$._embedded.episodes[*].airstamp
$._embedded.episodes[*].season
$._embedded.episodes[*].number