无法从 Instagram 获取所有标签 API
Can't get all tags from Instagram API
我正在使用 python-instagram
client and I want to grab all the photos of a specific tag. In this example I want an instance of this URL: https://www.instagram.com/explore/tags/flowers/
目前它只拍摄我个人从我的帐户上传的带有该标签的照片。
这是我的代码:
# Instagram
ACCESS_TOKEN = 'X'
CLIENT_SECRET = 'X'
CLIENT_ID = 'X'
INSTAGRAM_API = InstagramAPI(access_token=ACCESS_TOKEN, client_id=CLIENT_ID, client_secret=CLIENT_SECRET, redirect_uri='http://localhost:8000/')
recent_instagram_media, next_ = settings.INSTAGRAM_API.tag_recent_media(count=5, max_tag_id=5, tag_name='flowers')
photos = []
for media in recent_instagram_media:
photos.append(media.images['standard_resolution'].url)
我这里做错了什么?
可以通过检查您的应用程序是否在 sandbox mode
中来解释此行为。 Instagram 上的每个新应用程序都从 sandbox mode
开始。在此模式下,您只会接触到您应用中其他沙盒用户(限制为 10 个用户)的数据。
来自API:
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.
我正在使用 python-instagram
client and I want to grab all the photos of a specific tag. In this example I want an instance of this URL: https://www.instagram.com/explore/tags/flowers/
目前它只拍摄我个人从我的帐户上传的带有该标签的照片。
这是我的代码:
# Instagram
ACCESS_TOKEN = 'X'
CLIENT_SECRET = 'X'
CLIENT_ID = 'X'
INSTAGRAM_API = InstagramAPI(access_token=ACCESS_TOKEN, client_id=CLIENT_ID, client_secret=CLIENT_SECRET, redirect_uri='http://localhost:8000/')
recent_instagram_media, next_ = settings.INSTAGRAM_API.tag_recent_media(count=5, max_tag_id=5, tag_name='flowers')
photos = []
for media in recent_instagram_media:
photos.append(media.images['standard_resolution'].url)
我这里做错了什么?
可以通过检查您的应用程序是否在 sandbox mode
中来解释此行为。 Instagram 上的每个新应用程序都从 sandbox mode
开始。在此模式下,您只会接触到您应用中其他沙盒用户(限制为 10 个用户)的数据。
来自API:
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.