This repository contains a collection of API calls for managing and monitoring your PI-hole DNS server. PI-hole is a network-wide ad blocker that blocks ads at the DNS level, providing a streamlined and ad-free browsing experience across your entire network.
This collection enables you to automate the management of your PI-hole server, integrate it with other systems, and streamline your ad-blocking configuration. The provided API calls cover various functionalities, including managing blacklists and whitelists, enabling or disabling domains, and retrieving system statistics.
-
Import the Collection:
- Download the Postman collection JSON file and import it into your Postman app.
-
Configure Environment:
- Set up your environment variables such as
pihole
andpiholetoken
to match your PI-hole instance.
- Set up your environment variables such as
-
Execute Requests:
- Use the various requests in the collection to manage your PI-hole server, adjusting parameters as needed.
This collection includes a set of API calls for managing and monitoring a PI-hole DNS server. PI-hole is a network-wide ad blocker that helps to block ads at the DNS level. The collection features endpoints to add or remove domains from blacklists and whitelists, enable or disable domains, and perform various administrative tasks. These API calls enable you to automate and streamline the configuration and management of your PI-hole instance.
- Description: Retrieves the current version of the PI-hole.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?version
- Headers: None
- Description: Retrieves a summary of PI-hole statistics in a formatted manner.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?summary&auth={{piholetoken}}
- Headers: None
- Description: Retrieves raw summary statistics of PI-hole.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?summaryRaw&auth={{piholetoken}}
- Headers: None
- Description: Retrieves the backend type of the PI-hole.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?type
- Headers: None
- Description: Retrieves PI-hole statistics for the last 10 minutes.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?overTimeData10mins&auth={{piholetoken}}
- Headers: None
- Description: Retrieves the most recently blocked domains.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?recentBlocked&auth={{piholetoken}}
- Headers: None
- Description: Retrieves the top 10 queried items.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?topItems=10&auth={{piholetoken}}
- Headers: None
- Description: Retrieves the sources of queries.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?getQuerySources=100&auth={{piholetoken}}
- Headers: None
- Description: Retrieves the top blocked sources.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?topClientsBlocked&auth={{piholetoken}}
- Headers: None
- Description: Retrieves the top queries and ads.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?topItems&auth={{piholetoken}}
- Headers: None
- Description: Retrieves the top clients dynamically.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?topClients=10&auth={{piholetoken}}
- Headers: None
- Description: Retrieves the top clients (default 10).
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?topClients&auth={{piholetoken}}
- Headers: None
- Description: Retrieves the percentages of query types.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?getQueryTypes&auth={{piholetoken}}
- Headers: None
- Description: Retrieves all queries.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?getAllQueries&auth={{piholetoken}}
- Headers: None
- Description: Retrieves the forwarding destinations.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?getForwardDestinations&auth={{piholetoken}}
- Headers: None
- Description: Retrieves the count of forwarding destinations.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?getForwardDestinations=10&auth={{piholetoken}}
- Headers: None
- Description: Retrieves cache information.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?getCacheInfo&auth={{piholetoken}}
- Headers: None
- Description: Retrieves over time data for clients.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?overTimeDataClients&auth={{piholetoken}}
- Headers: None
- Description: Adds a site to the blacklist.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?list=black&add=badsite.com&auth={{piholetoken}}
- Headers: None
- Description: Deletes a site from the blacklist.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?list=black&sub=badsite.com&auth={{piholetoken}}
- Headers: None
- Description: Adds a site to the whitelist.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?list=white&add=goodsite.com&auth={{piholetoken}}
- Headers: None
- Description: Deletes a site from the whitelist.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?list=white&sub=goodsite.com&auth={{piholetoken}}
- Headers: None
- Description: Retrieves the current status (Enabled/Disabled) of PI-hole.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?status&auth={{piholetoken}}
- Headers: None
- Description: Disables PI-hole.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?disable&auth={{piholetoken}}
- Headers: None
- Description: Disables PI-hole for a specified number of seconds.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?disable=20&auth={{piholetoken}}
- Headers: None
- Description: Enables PI-hole.
- Method: GET
- URL:
http://{{pihole}}/admin/api.php?enable&auth={{piholetoken}}
- Headers: None