Regarding Since& Before Parameter in the send Request

Currently one of my customer facing performance issues while running the query for Actions as it limit to 1000. So, Trello has suggested to use Before and since parameter in the request to get the records when we have more then 1000.

By specifying a time range using these parameters, can retrieve only the relevant subset of Actions data within that time frame, rather than fetching the entire dataset at once. This can significantly reduce the amount of data returned and improve query performance.

Here’s how we incorporate the “Before” and “Since” parameters into our query:
GET /1/boards/{id}/actions?before={timestamp}&since={timestamp}

But our Actions table has almost 3000+ records but still we are able to fetch the 50 records. Can you please help us on same.

Yes, that is correct. That is what you must do, as described in the documentation.

It’s not clear what you mean by ‘help us’? You already know what to do…which is to use the before and since parameters, and the absolute maximum number of Actions that will ever be returned in a single query is 1,000. You cannot, will not, ever get all 3,000 Actions in one request. That’s all there is to it, and there’s nothing anybody on this forum can do to change that fact.

It is your responsibility to break the request down into batches and to make multiple requests to eventually get all the Actions.

Hi Sunnyape,

But as per the API documentation it says that we can iterate more than 1000 records as per below lines:
When querying for long lists, such as a list of Cards, or a list of Actions, the Trello API limits you to at most 1000 results. Because these lists can have members added or removed at any time, the right way to iterate through more than 1000 results is to use the before and since parameters.

Could you please explain the above statement and help us to understand with live examples on how we can iterate through more than 1000 results even though paging max size is 1000.

Hello @sandhya

The documentation is completely correct and means exactly what it says, especially where it says:

This means to page through the Actions on a large Board, you should request the Actions and then pass the ID of the last Action as the before parameter.

The topic of how to use paging in Trello’s REST API has been extensively discussed many times before in many other locations. If you use Google and search for ‘Trello REST API paging examples’ you’ll find examples.

You use the words ‘we’ , ‘us’ and ‘our’, so you are obviously part of a team or group of developers. If the members of your team make the effort to read those existing articles themselves, then they experiment with the before and after parameters themselves as per the examples, then they should have no problem working it out by themselves.

I hope you and your team have an enjoyable learning journey.

Hi @sunnyape ,

Thanks for the explanation.

I thought that in a single request we can fetch more than 1000 results but there is max limit of 1000 and nothing can be change here.

Thanks for the help.