cloudflare/cloudflare-php
PHP
Captured source
source ↗cloudflare/cloudflare-php
Description: PHP library for the Cloudflare v4 API
Language: PHP
License: BSD-3-Clause
Stars: 670
Forks: 269
Open issues: 90
Created: 2017-08-14T17:23:07Z
Pushed: 2026-06-18T21:01:47Z
Default branch: master
Fork: no
Archived: no
README:
Cloudflare SDK (v4 API Binding for PHP)
> Note: This is a community-maintained PHP SDK covering a subset of the > Cloudflare API. A comprehensive, auto-generated PHP SDK is planned for the > future. In the meantime, for full API coverage consider using the > Cloudflare API directly.
Requirements
- PHP 8.1 or later
Installation
Install via Composer (cloudflare/sdk):
composer require cloudflare/sdk
Cloudflare API version 4
The Cloudflare API can be found here. Each API call is provided via a similarly named function within various classes in the Cloudflare\API\Endpoints namespace:
- [x] DNS Records
- [x] DNS Analytics
- [x] Zones
- [x] User Administration (partial)
- [x] Cloudflare IPs
- [x] Page Rules
- [x] Web Application Firewall (WAF)
- [ ] Virtual DNS Management
- [x] Custom hostnames
- [x] Manage TLS settings
- [x] Zone Lockdown and User-Agent Block rules
- [ ] Organization Administration
- [x] Railgun administration
- [ ] Keyless SSL
- [x] Origin CA
- [x] Crypto
- [x] Load Balancers
- [x] Firewall Settings
Getting Started
$key = new Cloudflare\API\Auth\APIKey('user@example.com', 'apiKey');
$adapter = new Cloudflare\API\Adapter\Guzzle($key);
$user = new Cloudflare\API\Endpoints\User($adapter);
echo $user->getUserID();Contributions
We welcome community contribution to this repository. [CONTRIBUTING.md](CONTRIBUTING.md) will help you start contributing.
Licensing
Licensed under the 3-clause BSD license. See the [LICENSE](LICENSE) file for details.
Notability
notability 3.0/10Routine PHP API client, not AI-specific.