Simple Cloudflare API | DNS Record

Get API Token 

https://dash.cloudflare.com/profile/api-tokens

Cloudflare API Documentation


List DNS

$ curl --location --request GET 'https://api.cloudflare.com/client/v4/zones/:zoneId/dns_records' \
        --header 'Accept: application/json' \
        --header 'Authorization: Bearer ${token}'

Get DNS

$ curl --location --request GET 'https://api.cloudflare.com/client/v4/zones/:zoneId/dns_records/:dnsId' \
        --header 'Accept: application/json' \
        --header 'Authorization: Bearer ${token}'

Patch DNS

$ curl --location --request PATCH 'https://api.cloudflare.com/client/v4/zones/:zoneId/dns_records/:dnsId' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ${token}' \
--data-raw '{
  "content": ${ip}
}'

patch-cloudflare-dns.py