Reputation: 11157
I am using the most popular api via instagram api In the document, it saying something about pagination and next_url but when I use the link below with my app ID. I don't see any pagination info in the json. Am i missing something? https://api.instagram.com/v1/media/popular?client_id=CLIENT-ID or https://api.instagram.com/v1/media/popular?client_id=CLIENT-ID&count=10
Upvotes: 1
Views: 10287
Reputation: 4007
media/popular
endpoint does not have a pagination object. As Ryan Ore explained some endpoints provide pagination and some dot not.
You check whether the endpoint has a pagination or not by "pagination": {}
object. If the object exists the endpoint has pagination.
Upvotes: 0
Reputation: 881
The pagination information will be empty if the requested user's feed has fewer posts than the default query count. In other words, if the instagram account only has five pictures, there is no pagination info.
Upvotes: 2
Reputation: 47861
you should get the pagination info back in a an object callged "pagination"
"pagination": {
"next_max_tag_id": "1335465136530",
"deprecation_warning": "next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead",
"next_max_id": "1335465136530",
"next_min_id": "1335465556125",
"min_tag_id": "1335465556125",
"next_url": "https:\/\/api.instagram.com\/v1\/tags\/cats\/media\/recent?callback=jQuery17201362594123929739_1335440328560&_=133544032857&client_id=xxx&max_tag_id=1335465136530"
}
Which has the next_url you are looking for
Upvotes: 2
Reputation: 43
There is not a lot of documentation around pagination on the official API.
Check out this tutorial for more guidance and depth.
http://eduvoyage.com/search-instagram-pagination.html
You need to use the "min_tag_id" and "max_tag_id" to get the images you want.
As your using the endpoint to get popular images, you might want to try something like this. https://api.instagram.com/v1/tags/cats/media/recent?callback=?&client_id=YOURID&max_tag_id=1364206789229
But if you are after a specific tag, try something like this. https://api.instagram.com/v1/tags/cats/media/recent?callback=?&client_id=YOURID&max_tag_id=1364206789229
Upvotes: 0