Sending Passwd Via Curl

Hello,

Does anyone know how to query the pihole stats via curl with a password. you can try

curl http://ipaddrhere/admin/api.php

and it works but the second that you try to query a password protected it just returns [ ]

thanks in advance!

https://curl.haxx.se/docs/manpage.html

Use

curl http://ipaddrhere/admin/api.php?auth=yourpwstring

where you can get your personal password string from your /etc/pihole/setupVars.conf

dl6er, thank you for the reply but that did not work. curl still returns [ ]

EDIT: is 'yourpwdstring' the password or some kind of tokenized pwd?
Is there documentation for pi hole api?

Look in /etc/pihole/setupVars.conf for the token to use:

WEBPASSWORD=yourpwstring

Yes, it is a token - that is what I meant. I added this possibility to do it via this securely hashed password so you can store it anywhere and others will never be able to reconstruct the plain-text password.