How do i get API Zone ID from 100 domains through api?

Hi so i’m planning to get 100 domains and add them to cloudflare however i will be adding DNS records through API and for that i need the Zone ID from the overview dashboard of each domain !

Is there a way i can get all 100 Zone ID’s from all domain without going manaully one by one with a browser ???

Is this what you are searching for?

#zone-list-zones

or

#account-subscriptions-list-subscriptions

1 Like

hi yes exactly got it to work with zennposter but getting all of the data from the domain which i don’t need

is there a way to get only domain name and the zone id just two ?

With this

curl -X GET “https://api.cloudflare.com/client/v4/zones?name=example.com&status=active&account.id=01a7362d577a6c3019a474fd6f485823&account.name=Demo Account&page=1&per_page=20&order=status&direction=desc&match=all”
-H “X-Auth-Email: [email protected]
-H “X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41”
-H “Content-Type: application/json”

this what i get

You can pipe the results into jq. I use a filter like the following:
jq '.result[] | "\(.id) \(.name)"'

2 Likes

Thanks for replaying can u please make me an example as I’m new at all this)) do I at Ur string to the end of the header?

That was the example. It runs straight on the command line. You just pipe the output of your Curl command into what he posted.

hi i missed the jq link )) tried it sill doesn’t work

jpplay is only asking you for the filter:
.result[] | "\(.id) \(.name)"

You can see at the bottom of your screenshot that you have a different command running to the one I gave as an example.

2 Likes

Omg mad your a life savor !!! thanks you above guys helped me all day too friends if you need any help with RU or arabic stuff pm me i will do my best thanks you so much for helping a noob out cheers

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.