C

Cloudflare API

by Cloudflare Free tier

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.

dnswafcdnsslworkersddosedgesecurityserverless

Quick Reference

Base URL 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
Pricing
90
Latency
38
Depth
86

Authentication

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

Pricing

Model freemium Starting price Free tier available Free quota Unlimited bandwidth on Free plan
PlanPrice/moIncluded
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.

Key Endpoints

MethodPathDescription
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

Sample Request

curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records?type=A" \
  -H "Authorization: Bearer $CF_API_TOKEN"

Sample Response

{
  "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.