According to the docs on Cards Nested Resource if my endpoint is /1/boards/{id}/cards
it is possible to pass limit
param of value from 1
to 1000
.
However in my case it throws API_TOO_MANY_CARDS_REQUESTED
whenever I pass limit
greater than 300
.
Is it possible to get more than 300 cards from a board in one API call? Or the limit
param actually accepts a number from 1
to 300
instead of 1
to 1000
?
Endpoint that I’ve checked is precisely
https://api.trello.com/1/boards/{board_id}/cards?checklists=all&actions=commentCard,copyCommentCard&fields=id,name,due,desc,dueComplete,idMembers,closed,idList,pos,idAttachmentCover&attachments=true
If you check out the message that comes along with the API_TOO_MANY_CARDS_REQUESTED
error, it’ll give us some clues:
Requested too many cards with action loads, please limit
There is a limit to the number of cards that can be returned if the cards’ actions are also being returned.
If you don’t request the actions for the cards, you won’t hit the error:
https://api.trello.com/1/boards/{board_id}/cards?checklists=all&fields=id,name,due,desc,dueComplete,idMembers,closed,idList,pos,idAttachmentCover&attachments=true
Requesting actions in addition to cards gets very expensive DB-wise very quickly.
Instead, we recommend making additional requests for card’s actions after you’ve received all of the cards from your initial request.
1 Like
Ah alright, there’s a note in docs under /cards?actions
param Note: If you ask for actions, Trello limits the number returned to 300.
I just didn’t realize it concerns CARDS - I assumed that ACTIONS limit is 300