【发布时间】:2017-07-21 09:00:34
【问题描述】:
我正在尝试通过 Instagram API 获取关注者列表。 在此过程中,Instagram API 没有给我分页键,如下所示。
我处于沙盒模式并创建应用程序以通过 Instagram API 的审核。也试过直接通过Python库获取数据,还是不行。
你能告诉我如何获得分页键吗?
from instagram.client import InstagramAPI
access_token = "ACCESS_TOKEN"
client_secret = "CLIENT_SECRET"
api = InstagramAPI(access_token=access_token, client_secret=client_secret)
followed_by, next = api.user_followed_by()
print next # -> None
# 'pagination' key is empty.
# https://api.instagram.com/v1/users/self/followed-by.json?access_token=ACCESS_TOKEN
# {
# "pagination": {},
# "data": [
# {
# "id": "1111111111",
# "username": "xxxx_xxxx",
# "full_name": "xxxxxxxxx",
# "profile_picture": "..."
# },
# {
# "id": "2222222222",
# "username": "yyyy_yyyy",
# "full_name": "yyyyyyyyy",
# "profile_picture": "..."
# },
# ],
# "meta": {"code": 200}
# }
【问题讨论】:
标签: python instagram instagram-api