使用 /locations/location-id/media/recent Instagram 分页

Pagination with /locations/location-id/media/recent Instagram

我正在使用 Instagram API 的 https://api.instagram.com/v1/locations/{location-id}/media/recent 端点在特定位置获取 post,但我在实现分页时遇到了问题。

请求https://api.instagram.com/v1/locations/106970059456743/media/recent?ACCESS_TOKEN=(ACCESS_TOKEN)

问题来自 MAX_ID 和 MIN_ID 参数,因为在我从第一个查询得到的响应中,分页对象是空的(参见 https://www.instagram.com/developer/endpoints/),我已经尝试在参数中插入最近的 posts 的 id,当我要求新的 posts 时它似乎不起作用,但它确实在我要求时起作用年长 post.

我已经成功地实现了 https://api.instagram.com/v1/tags/{tag}/media/recent 端点的分页,但显然这个端点使用不同的分页(media/recent 在响应中 return 一个分页对象)。

如果您处于沙盒模式,在沙盒模式下您只能在 API 响应中获得 20 个帖子,分页在沙盒中不起作用,这是预期的行为。当您进入实时模式时,您将获得所有帖子和分页。