Hi there, does someone have an easy method of taking the out of the API call and exporting to CSV? I am trying to get a list of all the zones and if they are active or in a pending state…
The API typically (always?) outputs JSON. You can use jq to extract and format the results. Something like this should do the trick:
curl -X GET https://api.cloudflare.com/client/v4/zones -H "Content-Type:application/json" -H "X-Auth-Key:magickey" -H "X-Auth-Email:[email protected]" | jq -r '.result | "\(.name),\(.status)"'
Thank you Michael, exactly what i wanted how do i get that to show more than 20 results? I have over 400 domains
In the API there is a per_page query parameter. Search for Pagination at https://api.Cloudflare.com
Thanks again Michael, i’ve got it working
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.