I am developing a REST api endpoint that accepts a list of item IDs and will return some details for each item.
Let's make the following assumptions
- Performance wise in the DB there is no significant difference whether the endpoint accepts 10/100/1000 etc IDs.
- The details that will be returned for each ID are a JSON with no more than 10 key-values or so per ID. No nested items that can bloat the response payload.
- This is a GET request. So the IDs will have to be sent to the endpoint in the query of the request
The question then is how to determine the maximum number of IDs a single request should handle?
If there is no business reason should I limit the maximum number (maybe to make the request more human readable and the logs easier to work with) or let the technical limitations (such as maximum url length) be the only limits.
GETrequest, this might interest you. BTW, your question is being downvoted because it lacks a reason why you would want to limit it. Generally, "best practice" questions are not good questions, since they lead to opinionated answers.