{"id":15148437,"url":"https://github.com/evilfreelancer/pihole-api-php","last_synced_at":"2025-10-19T14:07:21.367Z","repository":{"id":62503212,"uuid":"217156315","full_name":"EvilFreelancer/pihole-api-php","owner":"EvilFreelancer","description":"Pi-Hole API PHP7 client","archived":false,"fork":false,"pushed_at":"2020-02-29T19:24:30.000Z","size":8,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-10T02:23:16.669Z","etag":null,"topics":["api-client","php7","pi-hole","pihole","rest-api"],"latest_commit_sha":null,"homepage":"https://pi-hole.net/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EvilFreelancer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-23T21:24:55.000Z","updated_at":"2023-04-24T06:30:08.000Z","dependencies_parsed_at":"2022-11-02T12:30:20.058Z","dependency_job_id":null,"html_url":"https://github.com/EvilFreelancer/pihole-api-php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fpihole-api-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fpihole-api-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fpihole-api-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fpihole-api-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvilFreelancer","download_url":"https://codeload.github.com/EvilFreelancer/pihole-api-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219866820,"owners_count":16555824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","php7","pi-hole","pihole","rest-api"],"created_at":"2024-09-26T13:03:47.794Z","updated_at":"2025-10-19T14:07:21.261Z","avatar_url":"https://github.com/EvilFreelancer.png","language":"PHP","readme":"[![Latest Stable Version](https://poser.pugx.org/evilfreelancer/pihole-api-php/v/stable)](https://packagist.org/packages/evilfreelancer/pihole-api-php)\n[![Build Status](https://travis-ci.org/EvilFreelancer/pihole-api-php.svg?branch=master)](https://travis-ci.org/EvilFreelancer/pihole-api-php)\n[![Total Downloads](https://poser.pugx.org/evilfreelancer/pihole-api-php/downloads)](https://packagist.org/packages/evilfreelancer/pihole-api-php)\n[![License](https://poser.pugx.org/evilfreelancer/pihole-api-php/license)](https://packagist.org/packages/evilfreelancer/pihole-api-php)\n[![Code Climate](https://codeclimate.com/github/EvilFreelancer/pihole-api-php/badges/gpa.svg)](https://codeclimate.com/github/EvilFreelancer/pihole-api-php)\n[![Code Coverage](https://scrutinizer-ci.com/g/EvilFreelancer/pihole-api-php/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/EvilFreelancer/pihole-api-php/?branch=master)\n[![Scrutinizer CQ](https://scrutinizer-ci.com/g/evilfreelancer/pihole-api-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/evilfreelancer/pihole-api-php/)\n\n# Pi-Hole API PHP client\n\n    composer require evilfreelancer/pihole-api-php\n\n## How to use\n\n```php\n$config = new \\PiHole\\Config([\n    'webpassword' =\u003e '6b600e5555af97b26ed51a5910a0b310d9da8e22a7aaf97ab0137bb4880ec55e',\n    'base_url'    =\u003e 'http://192.168.1.10/admin/api.php'\n]);\n\n$client = new \\PiHole\\Client($config);\n\n// Get all stats\n$statistics = $client-\u003estatistics()-\u003eexec();\nprint_r($statistics);\n\n// Get version of PiHole\n$version = $client-\u003eversion()-\u003eexec();\nprint_r($version);\n\n// Enable ADBlocking on PiHole\n$enable = $client-\u003eenable()-\u003eexec();\nprint_r($enable);\n\n// Disable ADBlocking on PiHole\n$disable = $client-\u003edisable()-\u003eexec();\nprint_r($disable);\n\n// Logout from PiHole\n$logout = $client-\u003elogout()-\u003eexec();\nprint_r($logout);\n```\n\n## List of available configuration parameters\n\n| Parameter         | Type   | Default | Description |\n|-------------------|--------|---------|-------------|\n| webpassword       | string |         | (required) Hash of password |\n| base_url          | string |         | (required) Url with path to admin.php |\n| proxy             | string |         | HTTP proxy connection string |\n| json_force_object | bool   | true    | Will enable flag JSON_FORCE_OBJECT of json_encode |\n| timeout           | int    | 10      | Max timeout for answer from RouterOS |\n| attempts          | int    | 10      | Count of attempts to establish TCP session |\n| delay             | int    | 1       | Delay between attempts in seconds |\n| debug             | bool   | true    | Enable full debug of all HTTP queries |\n\n# Links\n\n* https://pi-hole.net\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilfreelancer%2Fpihole-api-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevilfreelancer%2Fpihole-api-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilfreelancer%2Fpihole-api-php/lists"}