
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
This package provides a simple, modular SDK for the PiHole 6 REST API.
Install using pip
:
pip install pihole6api
Install from source:
git clone https://github.com/sbarbett/pihole6api.git
cd pihole6api
pip install -e .
from pihole6api import PiHole6Client
client = PiHole6Client("https://your-pihole.local/", "your-password")
history = client.metrics.get_history()
print(history) # {'history': [{'timestamp': 1740120900, 'total': 0, 'cached': 0 ...}]}
queries = client.metrics.get_queries()
print(queries)
client.dns_control.set_blocking_status(False, 60)
print(client.dns_control.get_blocking_status()) # {'blocking': 'disabled', 'timer': 60 ...}
client.group_management.add_group("Custom Group", comment="For testing")
client.group_management.delete_group("Custom Group")
client.domain_management.add_domain("ads.example.com", "deny", "exact")
client.domain_management.delete_domain("ads.example.com", "deny", "exact")
client.list_management.add_list("https://example.com/blocklist.txt", "block")
client.list_management.delete_list("https://example.com/blocklist.txt", "block")
# Export settings and save as a .zip file
with open("pihole-settings.zip", "wb") as f:
f.write(client.config.export_settings())
client.config.import_settings("pihole-settings.zip", {"config": True, "gravity": {"group": True}})
client.actions.flush_logs()
client.actions.restart_dns()
Module | Description |
---|---|
metrics | Query history, top clients/domains, DNS stats |
dns_control | Enable/disable blocking |
group_management | Create, update, and delete groups |
domain_management | Allow/block domains (exact & regex) |
client_management | Manage client-specific rules |
list_management | Manage blocklists (Adlists) |
config | Modify Pi-hole configuration |
ftl_info | Get Pi-hole core process (FTL) info |
dhcp | Manage DHCP leases |
network_info | View network devices, interfaces, routes |
actions | Flush logs, restart services |
Please check CONTRIBUTING.md for contribution guidelines.
See CHANGELOG.md for a list of changes.
This project is license under the MIT license.
FAQs
Python API Client for Pi-hole 6
We found that pihole6api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.