❔ How to read json api data from remote server that uses paging?
So I need some direction of how we can pull all data from a json api website that only sends 50 items per page. I can pull json data successfully but I only get the first 50 items out of at least 1030 items total. How do we make the server give us the rest of the data? On my end what structure would I use to build or receive it?
10 Replies
that depends on the API
read its docs, it will have instructions on how to get more pages
Usually there's some
?page=3
or whatever paramYes
It does say that..
However how do we build the list to receive all of it? @jcotton42
Loop it
Get all the lists
Assemble one
careful with ratelimits when paginating that way tho 😄
Yeah dont want to get blacklisted
it probably uses OData
depending on the version
but you should get a string for your next request (your next page)
something like
Odata_next_page: "api/foo/items?$skip20"
or something like that
you can add logic to your code to map your pagination to the requests
using this data
"probably" based on what?
just guessing
but if it paginates it should send the next link or whatever
in the response
following good practice
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.
Was this issue resolved? If so, run /close
- otherwise I will mark this as stale and this post will be archived until there is new activity.