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:

https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/#paging
GET /1/boards/{id}/actions?before={timestamp}&since={timestamp}

https://api.trello.com/1/boards/5c40d9d9991a0e43239670e9/actions?before=2024-04-26&since=2019-01-08T01:09:05.000Z&key=d9400ac12607c5bc3b6bd21bd0b9f2123&token=d051128f68523861505ae4b554d8b5278c74c689ff9415b192ebe8a69310b123

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.

https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/#paging

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.