I used to be able to get info from api.php and use this for graphs in Domoticz.
The api does some things but does not return much info anymore.
I have a Raspberry Pi 3+ with Buster and apache.
pihole -v
Pi-hole version is v5.14.2 (Latest: v5.14.2)
AdminLTE version is v5.18 (Latest: v5.18)
FTL version is v5.20 (Latest: v5.20)
The curl commands below are from my Ubuntu laptop. I have the same results from web browsers and from the commandline on the Raspberry Pi itself. Also when I use localhost or 127.0.0.1 on the Raspberry Pi