No pagination information using instagram API

Zahra Aminolroaya picture Zahra Aminolroaya · Nov 20, 2015 · Viewed 8.4k times · Source

I used this URL to get the recent media about specific tag like cats using Instagram API. the URL is like this:

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

Unfortunately, there is no data and I got the below warning in pagination:

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

how can I get min_tag_id or min_tag_id? why there is no data?

Answer

svenson picture svenson · Nov 21, 2015

I assume you created your client for this request after Nov. 17 2015. Instagram made some changes to their API, see here.

Apps created on or after Nov 17, 2015 will start in Sandbox Mode and function on newly updated API rate-limits and behaviors.

Your app/client is probably in sandbox mode and thus it has limited behavior. It's written down in the docs, section API behaviour:

Data is restricted to sandbox users and the 20 most recent media from each sandbox user.

[...]

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.

If you create a "cat" tag with your sandbox user, you should see it. Once your app has switched to live, you should see all public available "cat" tags.

Regarding the deprecated warnings, they are normal as they inform apps that used the "old way" about breaking changes. In your case they can be ignored.