Instagram new API, get items by tag

Instagram's API was updated last month, and I can't figure out how to work with it.

For example, I want to get images through the nexus5x tag.

I am asking for https://api.instagram.com/v1/tags/nexus5x?access_token=access_token

and the answer

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

Can you explain to me what to do next?

I also tried to get the latest articles.

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

but get this answer

200 '{"pagination": {"deprecation_warning": "next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead of"}, "meta": {"code": 200}, "data": []} ''

PS The application is in the sandbox.

+5
source share
1 answer

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

As another example, consider an endpoint that returns a list of media: / tags / {tag-name} / media / recent. The response returned by this endpoint will only contain media with the specified tag, as expected. But instead of returning media from any public Instagram user, this will only return media belonging to your sandbox users, the last 20 for each user.

So, if u add a message to instagram with hashtag, then it will appear in api response, this is a limitation in sandbox mode

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

+1
source

Source: https://habr.com/ru/post/1237807/


All Articles