List all registered domains

I am trying to use the API to get a listing of all registered domains and this is proving to be very difficult. There must be some simple way to get the listing like the dashboard does.

Thank you

Run this request (adjust the jq part to get the parameters you need)…

curl --request GET \
  --url https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/registrar/domains \
  --header 'Content-Type: application/json' \
  --header 'X-Auth-Email: [email protected]' \
  --header 'X-Auth-Key: {GLOBAL_API_KEY}' \
| jq -r '.result[] | "\(.name) \(.name_servers) \(.expires_at)"' 
3 Likes

Where do I find the account_id? I know there is an account id associated with each website, but I wouldn’t think that would what is expected…

Go to the Overview page of any zone, the account ID is shown down the right hand side.

Or just copy the long hex number that appears in your browser address bar following dash.cloudflare.com.

2 Likes

Thank you!

1 Like

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