API zone ID won't display all domains

I created an API GET call for listing Zone ID’s but I don’t know why it’s not displaying all the domains. Is there a limit to the domains it can display?

I believe the API will paginate results. This mean that you have to request each page of the results. You can increase the number of zones returned in one API call up to 50.

2 Likes

What would be the workaround or method to get all the domains?

Paginate the results.
https://api.cloudflare.com/#getting-started-requests

1 Like

You need to use paginate to get all the results. On the API docs there CTRL+F Pagination.
At the end of a request with paginate there a JSON object of

"result_info": {
    "page": 1,
    "per_page": 20,
    "count": 1,
    "total_pages": 200
  }

You want to keep increasing the page number until it reaches the last page number, so example requests would be

  1. GET https://api.cloudflare.com/client/v4/zones?page=1
  2. GET https://api.cloudflare.com/client/v4/zones?page=2
    All the way until there are no more pages.
2 Likes

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