Instagram 业务发现 API 分页令牌不起作用?

Instagram Business Discovery API Pagination Token not working?

我正在尝试使用 Instagram 业务发现 API 从某个 public 页面获取 post 统计数据。

例如

洗澡和 Body 工作 (https://www.instagram.com/bathandbodyworks)。

GET graph.facebook.com
   17895695668004550?fields=business_discovery.username(bathandbodyworks){followers_count,media_count,media{timestamp,like_count,comments_count}}

这将给我以下响应:

{
"business_discovery": {
"followers_count": 3526159,
"media_count": 3536,
"media": {
  "data": [
    {
      "timestamp": "2018-05-16T20:00:54+0000",
      "like_count": 28925,
      "comments_count": 530,
      "id": "17917935010179826"
    },

    (24 posts data omitted...)

    "paging": {
    "cursors": {
      "after": "QVFIUlBNak5fNTc3eThl..." (a very long string)
    }
  }
}

现在,这只给我最近的 25 posts,我认为这是 Facebook 设置的每个请求的限制。

如果我想加载接下来的 25posts 怎么办?

YouTube Data API 中,每个请求也有 50 个限制,但提供 "nextPageToken" 以加载下一个 50 post。我假设这里也是同样的情况?

我还在 this Facebook API document 中发现也许我可以添加一个游标字符串,例如:&after=QVFIUlBNak5fNTc3eThl...

但这行不通。

如有任何建议,我们将不胜感激,谢谢!

business_discovery的分页与Facebook有点不同 分页。

没有 nextprevious url。

您需要添加,after 游标,例如:

https://graph.facebook.com/v2.12/xxxx?fields=business_discovery.username(jacqehoward){id,name,username,website,profile_picture_url,biography,followers_count,media_count,media.after(QVFIUlZA5aTR5NTE4Y24tNW90VGZAPTVBtb0NpOEFPTlNLeklmVTEtUDZAfVnE0YnBhUVNOQ3BDaktzNHJBTENhTmVYLUV2SGJPZAVAxZA09hQ2NhUGdnUGFjMTNn){id,caption,comments_count,like_count,media_type,media_url,owner,timestamp}}

注:

media.after(after_cursor){media_fields}

如果您想通过 business_discovery 分页到最后,您必须添加 after 光标,直到只有 previous 光标响应。这是您达到第一个 post.

的标记