Cloud Infrastructure, DNS, Security & Edge Computing
Cloudflare API
The Cloudflare API provides programmatic management of supported Cloudflare resources, including DNS records, zones, security settings, Workers, account resources, and edge infrastructure. It enables developers to automate website configuration, infrastructure operations, and selected cloud security workflows.
Key features
- Create, update, list, and delete DNS records.
- Manage zones and supported domain configuration.
- Configure supported security and firewall rules.
- Manage Workers scripts and related deployment resources.
- Retrieve analytics and operational information through supported APIs.
- Manage account and zone settings with appropriate permissions.
- Configure supported caching and performance settings.
- Automate infrastructure configuration across multiple zones and accounts.
Pricing
- Cloudflare offers a Free plan for eligible core website services, with paid Pro, Business, and Enterprise offerings. Many Cloudflare management API operations are available without a separate per-request charge, but access to particular resources depends on the account plan and enabled products. Cloudflare Workers, R2 storage, D1 databases, KV, Durable Objects, and other developer services have their own free allowances and usage-based pricing. Charges may depend on requests, compute duration, storage, reads, writes, and other product-specific metrics. Enterprise pricing is custom. Cloudflare pricing varies by product rather than following one universal API request price. Pricing: https://www.cloudflare.com/plans/ and https://developers.cloudflare.com/workers/platform/pricing/
Best use cases
- Automating DNS management.
- Provisioning and configuring website infrastructure.
- Managing edge application deployments.
- Automating security configuration across websites.
- Building infrastructure management dashboards.
- Integrating Cloudflare services into deployment pipelines.
Authentication method
Cloudflare recommends scoped API tokens, commonly transmitted using Authorization: Bearer. Legacy global API key authentication is also supported for applicable endpoints but provides broader account access and is generally less desirable. Token permissions can restrict operations by resource and product. Some services, including Workers and R2, have distinct authentication mechanisms for their runtime or storage APIs. Webhook and event verification mechanisms are product-specific rather than universal across the Cloudflare API.
