Instagram new API, get items by tag

亡梦爱人 提交于 2019-12-12 10:48:55

问题


Last month Instagram API was updated and I can't understand how work with it.

For example I want to get images via tag nexus5x.

I do request to https://api.instagram.com/v1/tags/nexus5x?access_token=access_token

and response is

200 '{"meta":{"code":200},"data":{"media_count":5066,"name":"nexus5x"}}'

Can you explain me what to do next?

I also tried get recent items

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

but get this response

200 '{"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":[]}'

P.S. App in sandbox.


回答1:


You are in Sandbox mode, so it will return only media from your sandbox authorized user, here is information about this:

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.

So if u add a post in instagram with the hashtag then it will show up in api response, this is restriction in sandbox mode

Here is the link to more details about Sandbox mode: https://www.instagram.com/developer/sandbox/



来源:https://stackoverflow.com/questions/34199140/instagram-new-api-get-items-by-tag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!