# Querying a HTTP JSON data source

**URL:** <https://community.grafana.com/t/querying-a-http-json-data-source/85107>\
**Category:** Stat Panel\
**Tags:** query-help, plugins\
**Created:** [April 4, 2023, 9:57am UTC](https://community.grafana.com/t/querying-a-http-json-data-source/85107 "2023-04-04T09:57:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanjastojanovic25](https://avatars.discourse-cdn.com/v4/letter/v/f14d63/32.png) [@vanjastojanovic25](https://community.grafana.com/u/vanjastojanovic25)\
**Post date:** [April 4, 2023, 9:57am UTC](https://community.grafana.com/t/querying-a-http-json-data-source/85107/1 "2023-04-04T09:57:47Z")

</div>

Hello everyone, thanks for taking the time to read this topic and helping me out in advance.

## Issue

The situation is as follows:  
I have a JSON file laying on a server that **is** reachable through HTTP with the URL [http://192.168.10.1:666/data.json](http://192.168.10.1:666/data.json), in Grafana I installed and configured the JSON file for parsing JSON responses from a backend, the specific JSON plugin is [JSON plugin for Grafana | Grafana Labs](https://grafana.com/grafana/plugins/simpod-json-datasource/) . The situation is as follows, using this as a data source on a panel, I want to display a number that is correlated to the key “active\_users”, the JSON file is as follows (some data is redacted for security reasons):

```auto
{
    "id": 18,
    "plan": "premium",
    "created_at": "2023-03-03T04:53:04.381+01:00",
    "starts_at": "2022-02-11",
    "expires_at": "2025-02-11",
    "historical_max": 449,
    "maximum_user_count": 449,
    "licensee": {
                     *Redacted*
                 },
    "add_ons": {

                },
    "expired": false,
    "overage": 0,
    "user_limit": 449,
    "active_users": 345
} 

```

## Question

How, with the given info, do I set up a panel that will query this data source and display the number of “active\_users”?

---

<div class="post-metadata">

**Author:** ![mikhailvolkov](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/mikhailvolkov/32/41625_2.png) [@mikhailvolkov](https://community.grafana.com/u/mikhailvolkov)\
**Post date:** [April 4, 2023, 12:26pm UTC](https://community.grafana.com/t/querying-a-http-json-data-source/85107/2 "2023-04-04T12:26:17Z")

</div>

The JSON plugin is not the right choice for this use case. JSON API or Infinity will work better from my point of view.

[![](https://img.youtube.com/vi/h1Mx4UvtKGY/maxresdefault.jpg "JSON Data Sources for Grafana | JSON API, Infinity, Simpod compared") ](https://www.youtube.com/watch?v=h1Mx4UvtKGY)

Also, we explained in the YouTube tutorial how to extract data from the JSON API and Infinity.

[![](https://img.youtube.com/vi/B4Uj1n4Cr88/maxresdefault.jpg "JSON API and Infinity Data Source tutorial for Grafana | How to display unemployment rate") ](https://www.youtube.com/watch?v=B4Uj1n4Cr88)

---

<div class="post-metadata">

**Author:** ![vanjastojanovic25](https://avatars.discourse-cdn.com/v4/letter/v/f14d63/32.png) [@vanjastojanovic25](https://community.grafana.com/u/vanjastojanovic25)\
**Post date:** [April 4, 2023, 1:49pm UTC](https://community.grafana.com/t/querying-a-http-json-data-source/85107/3 "2023-04-04T13:49:13Z")

</div>

Hi, @mikhailvolkov thanks for the reply and attached videos, I’m going to review the material and it out. I will report back with the results. Thanks again!

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [April 4, 2023, 4:05pm UTC](https://community.grafana.com/t/querying-a-http-json-data-source/85107/4 "2023-04-04T16:05:24Z")

</div>

As @mikhailvolkov said using infinity this is one approach

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/8/7/87562a42d79e922a67e82edf0a2c35e2ea6067eb.png)

---

<div class="post-metadata">

**Author:** ![vanjastojanovic25](https://avatars.discourse-cdn.com/v4/letter/v/f14d63/32.png) [@vanjastojanovic25](https://community.grafana.com/u/vanjastojanovic25)\
**Post date:** [April 6, 2023, 6:02am UTC](https://community.grafana.com/t/querying-a-http-json-data-source/85107/5 "2023-04-06T06:02:15Z")

</div>

@mikhailvolkov successfully installed the JSON API plugin and set the data source to the server I mentioned in the original question [http://192.168.10.1:666/](http://192.168.10.1:666/), where I then set the path of the GET request inside the panel query section to /data.json. The query returns an empty JSON object i.e. {} and not the actual data, but when I request just the source without specifying any other path, I get a valid HTML document which allows for directory browsing. Do you maybe know what’s going on?

P.S. I’m adding these images to show you the current settings:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/1/5/159ab6d74a3693ee24c2501ed705c438db1f098b.png)

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/0/c/0c169fd2ae0384c15f502090ac7e069a1fddf8cf.png)

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/e/7/e740578007660af84863fcd1e10dc6f48a613bc4.png)

**Little update:**  
Even when using the Postman service to check the HTTP response, it gets a valid JSON file back in this format:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/e/6/e6d4c03450294f3b3143530d346617de2753bc22.png)

---

<div class="post-metadata">

**Author:** ![vanjastojanovic25](https://avatars.discourse-cdn.com/v4/letter/v/f14d63/32.png) [@vanjastojanovic25](https://community.grafana.com/u/vanjastojanovic25)\
**Post date:** [April 6, 2023, 10:44am UTC](https://community.grafana.com/t/querying-a-http-json-data-source/85107/6 "2023-04-06T10:44:02Z")

</div>

It appears that the problem was in the HTTP request as Grafana could not parse it, I changed the API from which I was getting the response and it works perfectly now! Thanks for all the help.
