首页 文章

Instagram API和分页

提问于
浏览
3

我无法使用Instagram API获取所有图像,Pagination似乎在某种程度上有所不同,我还无法理解它

我用请求:https://api.instagram.com/v1/users/self/media/recent?access_token=TOKEN

并且可以获得前20张照片:

...
{
  "attribution": null,
  "tags": [
    "beautiful",
    "instalife",
    "picoftheday",
    "beauty",
    "instalike",
    "gf",
    "traveling",
    "instatravel",
    "vsco",
    "tourism",
    "\u0438\u0441\u043f\u0430\u043d\u0438\u044f",
    "travelphoto",
    "vscogood",
    "instafollow",
    "travel",
    "\u0433\u0440\u0430\u043d\u0430\u0434\u0430",
    "amazing",
    "vscocam",
    "followme",
    "photooftheday"
  ],
  "type": "image",
  "location": null,
  "comments": {
    "count": 1
  },
  "filter": "Normal",
  "created_time": "1442825564",
  "link": "https:\/\/instagram.com\/p\/74vm3GOCEn\/",
  "likes": {
    "count": 18
  },
  "images": {
    "low_resolution": {
      "url": "https:\/\/scontent.cdninstagram.com\/hphotos-xap1\/t51.2885-15\/s320x320\/e15\/11934647_531283580370186_1131008999_n.jpg",
      "width": 320,
      "height": 320
    },
    "thumbnail": {
      "url": "https:\/\/scontent.cdninstagram.com\/hphotos-xap1\/t51.2885-15\/s150x150\/e15\/11934647_531283580370186_1131008999_n.jpg",
      "width": 150,
      "height": 150
    },
    "standard_resolution": {
      "url": "https:\/\/scontent.cdninstagram.com\/hphotos-xap1\/t51.2885-15\/e15\/11934647_531283580370186_1131008999_n.jpg",
      "width": 612,
      "height": 612
    }
  },
  "users_in_photo": [

  ],
  "caption": {
    "created_time": "1442825564",
    "text": "#\u0413\u0440\u0430\u043d\u0430\u0434\u0430 #\u0418\u0441\u043f\u0430\u043d\u0438\u044f #photooftheday #picoftheday #instalike #followme #vscogood #vscocam #vsco #instafollow #travel #traveling #instatravel #instalife #tourism #gf #beauty #beautiful #amazing #travelphoto",
    "from": {
      "username": "solotravel_me",
      "profile_picture": "https:\/\/igcdn-photos-h-a.akamaihd.net\/hphotos-ak-xaf1\/t51.2885-19\/11282631_115839268762391_863189534_a.jpg",
      "id": "736938591",
      "full_name": "and"
    },
    "id": "1078821495951073761"
  },
  "user_has_liked": false,
  "id": "1078821489441513767_736938591",
  "user": {
    "username": "solotravel_me",
    "profile_picture": "https:\/\/igcdn-photos-h-a.akamaihd.net\/hphotos-ak-xaf1\/t51.2885-19\/11282631_115839268762391_863189534_a.jpg",
    "id": "736938591",
    "full_name": "and"
  }
}
...

之后我正在尝试使用max_id参数,但我不确定我需要使用哪个ID我尝试了照片的id,photo_user id,我甚至尝试了时间戳(在某些论坛上发现了这个想法),但每次收到只有前20张照片

示例:https://api.instagram.com/v1/users/self/media/recent?access_token=TOKEN&max_id=1078821495951073761

1 回答

  • 13

    当帐户实际上有更多照片时,我对空分页对象遇到了同样的问题 .

    而且只是为了清楚这里 . 这个问题在原始问题的评论中得到了回答 .

    分页对象中没有任何内容,因为应用程序处于沙盒模式,沙盒模式的应用程序永远不会返回超过20个帖子(照片) .

相关问题