December 25, 2022, 5:15pm
I have this script.
$curl = curl_init();
CURLOPT_URL => "https://api.cloudflare.com/client/v4/zones/".$z_id."/dns_records",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
$response = curl_exec($curl);
$err = curl_error($curl);
I have 220 dns records in my domain, but with that script i can see only 100 of them. how can i see the other records?
December 25, 2022, 5:18pm
PS: the result shows that i have 220 records and there are 3 pages, only 1 page is shown to me, what about 2 other pages?
[result_info] => Array
[page] => 1
[per_page] => 100
[count] => 100
[total_count] => 220
[total_pages] => 3
?page=2, etc. to your API request. You can also increase the
per_page option up to
Cloudflare API v4 Documentation for details.
December 25, 2022, 5:26pm
where should i add this - ?page=2
It’s a URL query parameter. So for example, you would hit
https://api.cloudflare.com/client/v4/zones/[id]/dns_records, and then
You will need to write your code to handle pagination if there are additional pages, and/or increase your
per_page to a higher value if you want this to be returned in a single request.
December 28, 2022, 5:29pm
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.