Pagination
Dievio uses page-based pagination with _page and _per_page.
Request fields
_page: page number (default 1)_per_page: number of rows per page (default 25)max_results: cap on total returned rows (default 500, max 100000)
The API may return fewer rows than _per_page if credits are lower than the requested page size.
Response fields
pageper_pagetotal_pagestotal_counthas_morenext_page(null whenhas_moreis false)
Example loop
let page = 1;
let results = [];
while (true) {
const res = await fetch('https://dievio.com/api/public/search', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.DIEVIO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ _page: page, _per_page: 100, max_results: 1000 }),
});
const data = await res.json();
results = results.concat(data.preview_data || []);
if (!data.has_more) break;
page = data.next_page;
}