This just came up with the JIRA gadgets (JIRA gadgets for TestRail). They way I handled it was I used the filter options limit and offset. (I also used the status_id and created_after to limit the results returned. Using status_id is a nice way to filter out the null statuses.) Here’s the high level algorithm I used:

@vverdeil: if a test run has more than 250 results, you can use the limit and offset parameters to iterate through the list of results. This is to make sure that even runs with thousands or more of results can be handled well and this is a common concept with APIs. You can see the same approach also in TestRail’s UI when you view the milestone activity/results, for example (with the pagination features).