Pagination info missing in instagram api

匆匆过客 提交于 2019-12-06 16:50:28

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

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.

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!