使用 instagram 没有分页信息 API

No pagination information using instagram API

我使用此 URL 获取有关特定 tag 的最新媒体,例如 cats 使用 Instagram APIURL 是这样的:

https://api.instagram.com/v1/tags/cats/media/recent?access_token=*****

不幸的是,没有数据,我在 pagination 中得到了以下 warning:

{"pagination":{"deprecation_warning":"next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead"},"meta":{"code":200},"data":[]}

如何获得 min_tag_idmin_tag_id?为什么没有data?

我假设您在 2015 年 11 月 17 日之后为此请求创建了客户端。Instagram 对其 API 进行了一些更改,请参阅 here

Apps created on or after Nov 17, 2015 will start in Sandbox Mode and function on newly updated API rate-limits and behaviors.

您的 app/client 可能处于沙盒模式,因此它的行为受到限制。它写在文档中,section API behaviour:

Data is restricted to sandbox users and the 20 most recent media from each sandbox user.

[...]

As another example, let's consider an endpoint that returns a list of media: /tags/{tag-name}/media/recent. The response returned by this endpoint will contain only media with the given tag, as expected. But instead of returning media from any public Instagram user, it will return only media that belongs to your sandbox users, restricted to the last 20 for each user.

如果您为沙盒用户创建了一个 "cat" 标签,您应该会看到它。一旦您的应用程序切换到实时状态,您应该会看到所有 public 个可用的 "cat" 个标签。

关于已弃用的警告,它们是正常的,因为它们会通知使用 "old way" 的应用程序有关重大更改。在你的情况下,它们可以被忽略。