API Question

Sorry if this is in the wrong location. I looked at the API FAQ regarding getAllQueries, but I noticed the FAQ covers up to field 5, but there are fields 6, 7 and 8 with no description. Can anyone shed any light on these?

["1585694700","A","gateway-asset.icloud-content.com","192.168.88.24","2","0","3","325"]

Thanks!

2 Likes

Which link did you follow? It's good to know that there is some description somewhere, because then we can look into updating it. The fields are "documented" in FTL's source code because this the place where the data is being generated:

The fields are:

  1. timestamp
  2. qtype
  3. domain
  4. client
  5. status
  6. dnssec
  7. reply
  8. delay

Description of the three fields that are missing to you:

dnssec is an integer following the definition:

  • 0 = unspecified (also set when DNSSEC validation inside pihole-FTL is not used)
  • 1 = SECURE
  • 2 = INSECURE
  • 3 = BOGUS
  • etc.

reply is an integer following this definition slightly below the other one:

  • 0 = unknown reply (most likely this means there was no reply due to an error or because it did not arrive, yet)
  • 1 = NODATA
  • 2 = NXDOMAIN
  • 3 = CNAME (this is the case in your example)
  • 4 = IP
  • etc. (see code above)

delay tells you the time in between the request and the answer to a query (milliseconds).

1 Like

It was the API FAQ (Pi-hole API), it appears to be something you created! :slight_smile:
Thank you!

Feb '17 ... I barely remember what happened last week, leave alone 3 years ago :wink:

2 Likes

That makes two of us. At least I was able to find it and get started with the API. Very handy and appreciated.

Hello @DL6ER, first up thank you for all your efforts writing and maintaining such a great project! I've been using Pihole for a bit over a month now and I really love it.

I came across this question after not being satisfied with the description in the Pi-hole API FAQ article. I was hoping to update the FAQ with the latest values from here but unfortunately the topic is locked or my powers aren't strong enough.

Would be great if you could update that if it's at all possible (I'm new to discourse).

Cheers,
Stefan

Hey Stefan,

we're in the middle* of replacing the existing API with an altogether rewritten RESTful API. The new API is designed to be unified in contrast to the current, organically-grown API parts scattered between Telnet (FTL) and PHP (doing some proxying, some post-processing).

The current development version of FTL for the v6.0-era lives in branch new/http. It is currently still possible to you check out this branch and go back without any consequences (still backwards-compatible). Once you have checked out FTL, you will get access to the fully embedded documentation of the version you're currently running. Furthermore, the documentation is automatically updated after each commit on our development server:

https://ftl.pi-hole.net/new/http/docs

However, mind that the embedded documentation allows you true interaction with the API, e.g. you can add/modify/remove domains from your Pi-hole while learning how to use it (using the "Try" feature), like querying the current statistics, etc. (live data, not some demo data):


*) About 50% of the work is done.

1 Like