Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Instagram new API, get items by tag

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.

like image 665
sesotesa Avatar asked Nov 09 '22 00:11

sesotesa


1 Answers

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/

like image 100
krisrak Avatar answered Nov 15 '22 04:11

krisrak