FTL icon indicating copy to clipboard operation
FTL copied to clipboard

Documentation Error: `GET /queries` Parameter Should Be `length`, Not `n`

Open sbarbett opened this issue 11 months ago • 1 comments

Versions

/ # pihole -v
Core version is v6.0.6 (Latest: v6.0.6)
Web version is v6.1 (Latest: v6.1)
FTL version is v6.1 (Latest: v6.1)

Platform

  • OS and version: Host system is Debian GNU/Linux 12 (bookworm) x86_64
  • Platform: Docker

Expected behavior

The documentation for the "GET /queries" endpoint should indicate that the parameter controlling the number of queries returned is length.

Actual behavior / bug

The current documentation incorrectly states that the parameter is n, even though the endpoint expects length. This discrepancy can lead to confusion when developers use the documented parameter.

Steps to reproduce

Steps to reproduce the behavior:

  1. Open the official Pi-hole API documentation.
  2. Navigate to the "GET /queries" endpoint.
  3. Note that the parameter is documented as n.
  4. Attempt to use n in a client, and observe that the endpoint requires the parameter to be length.

Screenshots

Image

Additional context

I maintain a small Python client for the Pi-hole API. A user recently reported this issue to me. I patched my client to accept both n (deprecated) and length for backwards compatibility. Here is a link to the commit where the patch was applied.

It would be great if the documentation could be updated to reflect the correct parameter name (length) to avoid further confusion.

sbarbett avatar Mar 31 '25 22:03 sbarbett

Ah, yes, sorry. It is correct in the API request description

Image

but wrong in the text for humans. Fixed by https://github.com/pi-hole/FTL/pull/2407

DL6ER avatar Apr 01 '25 07:04 DL6ER

Should be fixed with https://github.com/pi-hole/FTL/releases/tag/v6.3

yubiuser avatar Oct 26 '25 14:10 yubiuser