Popular Content

Showing content with the highest reputation on 05/13/18 in all areas

  1. 1 point
    yep, just keep on pulling till the next param gives you a null value. So similar to this (it is essentially how I do it) while (Next != null) { url = Next Result = API_Call(url) ...Process the result Next = Result.Next } Basic psudo code, but you should get the idea, and this will work no matter how small the page size gets.
  2. 1 point
    HangryDave, I had the same problem (also remarked in your mentioned thread from feanferr) and I can only recommend to ALWAYS inspect the value of the "next"-field in the JSON-result: { "count": 263, "next": "https://rebrickable.com/api/v3/lego/sets/7965-1/parts/?page=2", "previous": null, "results": [ {... It is possible, even if you use page-size of 1000, that the API doesn't return you 1000 but for example only 100 (it's per configuration and depends on performance and can even be changing dynamically). So to receive the complete result you've got to call the url given by next (if it isn't null) and collect the results until you have next == null. This is the nearly the only way to determine that you've got the full result. And because this is valid for nearly all GET-API-methods, you should try to handle it in general on all your API-GET-calls. The other way to determine is to count your number of results received (the count of elements in result-array) and compare that to the number given in the "count"-field at the beginning. And then you can use next-URL to receive the next page.