The Cloudflare API provides programmatic control over the entire Cloudflare platform. Manage DNS records (A, CNAME, MX, TXT), configure Web Application Firewall rules and IP access rules, issue and renew SSL/TLS certificates, deploy and update Cloudflare Workers (serverless edge functions) and Workers KV, manage Cloudflare Pages projects, configure caching rules, view analytics and threat data, and set up rate limiting. Used for infrastructure automation, security policy management, and edge deployment workflows.
https://api.cloudflare.com/client/v4
Auth type
API Key Header
Auth header
Authorization: Bearer YOUR_API_TOKEN
Rate limit
1,200 requests/5 min (global)
Pricing
Free tier available
Free quota
Unlimited bandwidth on Free plan
Documentation
https://developers.cloudflare.com/api/
Endpoint status
Server online — HTTP 404 — server is online but path returned an error (may require auth)912ms
(checked Mar 29, 2026)
Builder score
B
73%
builder-friendly
Use an API Token (recommended) with specific permission scopes, or a Global API Key with X-Auth-Email + X-Auth-Key headers. Create tokens at dash.cloudflare.com/profile/api-tokens.
Authorization: Bearer YOUR_API_TOKEN
| Plan | Price/mo | Included |
|---|---|---|
| Free | Free | CDN, DDoS, DNS, 100k Workers req/day |
| Pro | $20 | WAF, image optimization, analytics |
| Business | $200 | Custom SSL, advanced caching |
| Enterprise | $0 | Custom pricing, SLA |
Free: CDN, DDoS protection, DNS. Pro: $20/mo. Business: $200/mo. Enterprise: custom. Workers: 100k req/day free.
| Method | Path | Description |
|---|---|---|
| GET | /zones/{zone_id}/dns_records |
List all DNS records for a zone |
| POST | /zones/{zone_id}/dns_records |
Create a new DNS record |
| PATCH | /zones/{zone_id}/dns_records/{id} |
Update a DNS record |
| GET | /zones/{zone_id}/firewall/rules |
List WAF firewall rules |
| PUT | /accounts/{account_id}/workers/scripts/{name} |
Deploy or update a Worker script |
| GET | /zones/{zone_id}/analytics/dashboard |
Get traffic and threat analytics |
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records?type=A" \ -H "Authorization: Bearer $CF_API_TOKEN"
{
"success": true,
"result": [{
"id": "372e67954025e0ba6aaa6d586b9e0b59",
"type": "A",
"name": "apimap.dev",
"content": "104.21.0.1",
"ttl": 1,
"proxied": true
}]
}
Data sourced from API Map. Always verify pricing and rate limits against the official Cloudflare documentation.