First of all, having discovered PiHole a few weeks ago I have to say what an awesome project. Now installed on a RaspberryPi-3, with some extra blocklists downloaded from Wally3K, it is happily doing its job protecting me and my family at home. You Guys Rock
I have some Python successfully extracting stats from the admin/api.php with no authentication, but would like to also access some of the other stats requiring Authentication (e.g. topItems). However, I cannot work out how to specify this, not knowing the username or the Auth-Type.
Include your password in the pw variable when POSTing
Pass the WEBPASSWORD hash found in /etc/pihole/setupVars.conf in the auth GET variable
If you keep a session, you will continue to be authenticated for up to 30min since your last API call. We are working to improve the security and usability of the API, so stay tuned for upcoming changes!