Instagram /v1/tags/{tag-name}/media/recent endpoint doesn't return min_tag_id in pagination block

情到浓时终转凉″ 提交于 2019-11-28 18:23:22

It seems this was a temporary issue with the Instagram API and has now been resolved.

So upon further investigation, I noticed that you can use the id of the newest post to effectively filter out older posts from the https://api.instagram.com/v1/tags/tag-name/media/recent?access_token=ACCESS-TOKEN response, which now always returns the last 20 posts.

An id of a instagram post typically looks like xxxxxxxxxxxxxxxxxxx_yyyyyyyyyy where xxxxxxxxxxxxxxxxxxx is essentially the min_tag_id that used to be returned in the pagination block and yyyyyyyyyy is the user's id.

So you can extract the xxxxxxxxxxxxxxxxxxx part of a post's id(xxxxxxxxxxxxxxxxxxx_yyyyyyyyyy) and do a comparison to see if it is larger than the previous xxxxxxxxxxxxxxxxxxx that you were keeping track of to retrieve newer posts.

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