APIYard
Back to APIs
DevOpsBearer TokenFree tier

Cloudflare

Manage DNS records, configure caching rules, deploy Workers scripts, set up firewall rules, and control your entire Cloudflare stack programmatically.

Base URL

https://api.cloudflare.com/client/v4
DNSCDNWorkersfirewalledge

Endpoints

GET/zones/{zone_id}/dns_records

List DNS records for a zone.

const response = await fetch("https://api.cloudflare.com/client/v4/zones/ZONE_ID/dns_records?type=A", {
  method: "GET",
  headers: {
  "Content-Type": "application/json",
  "Authorization": "Bearer YOUR_ACCESS_TOKEN"
  }
});

const data = await response.json();
console.log(data);

Response Preview

{
  "result": [{
    "id": "372e67954025e0ba6aaa6d586b9e0b59",
    "type": "A",
    "name": "example.com",
    "content": "198.51.100.4",
    "proxied": true,
    "ttl": 1
  }],
  "success": true
}