What's the maximum limit allowed in a single content API call?

The maximum number of results returned in a single API call is 100, you can paginate results through the offset param,

something like this would make multiple api requests to get all the content from builder:

// pseudo code
const limit = 100;
let offset = 0;
const pages = await getResults({limit, offset});
while(pages.length === (limit + offset)) {
  offset += limit;
  pages.push( ... (await getResults({ limit, offset}));
}
return pages;
1 Like

how can we calculate the total number of items on the database so that the pagination can be done properly, e.g., deciding how to adjust the page size depending on the total number of items?

Hi @adler :wave: Thanks for reaching out.

We don’t currently have this functionality, but I will pass this along to our team as a feature request! We will keep you updated.

Thanks for the reply.
It’s a basic thing for an API payload to fetch data. Thus I’m really surprise this doesn’t exist with builder.

{
“data”: [///row columns],
“totalNumberOfRows”: 144000,
“currentPage”: 1,
“currentAmount”: 100
}

Hey @maddy / Builder team ,

As per last comment of Maddy -
We don’t currently have this functionality, but I will pass this along to our team as a feature request! We will keep you updated.

Is this implemented any chance ?

Hi @srittam ,

Currently there is no metadata on the model that would say how many elements exist for that model, but we have heard that feedback before, and it is something that we are currently taking a look at. The best process is to set a limit of 100 and then check if you get 100 results then make the call for the next 100 and so on

Thanks