curl "https://api.cloudflare.com/client/v4/zones?name=example.com" -H 'Authorization: Bearer $CF_API_TOKEN' | jq '.result[0].id'

Category: Cloudflare

curl "https://api.cloudflare.com/client/v4/zones?name=example.com" -H 'Authorization: Bearer $CF_API_TOKEN' | jq '.result[0].id'

Look up a zone ID by domain name

A zone is Cloudflare's representation of a domain you manage, and most DNS and cache API calls need its ID. This filters zones by name and extracts the ID with jq. Once you have ZONE_ID, export it and reuse it across the record and cache commands.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.