When you run the Pi-hole v6.0 beta, your Pi-hole will offer you a self-hosted API documentation matching the exact version of Pi-hole you have locally at http://pi.hole/api/docs
If you are just interested in the DNS status being UP or DOWN (not if blocking is temporarily disabled, etc.), have a look at /info/login and the property dns (you won't even need auth for this).