Instagram fetch the latest user media after max_id

Lets me get the latest user media for the tag ... And I can store in the database the information that it returns to me from the API.

Media IDs are something like [0-9] + _ [0-9] +, and suggests that the next day I want to receive only new data, so I order the medium that I saved in my DB, with using instagram created time, then I select the one that is its newest, and grab its identifier approximately as "121231232213123_12312312312".

Then I use this Id as the max_id attribute for the API endpoint https://api.instagram.com/v1/tags/ {tag_name} / media / recent, I would assume that I would get a new user_media or an empty array if no one didn't upload anything.

The fact is that I get all the same data, for example, if it does not filter my results and does not use max_id.

Is this the right behavior, or should I do something else?

thanks,

ps: I posted the same issue also to google groups:

https://groups.google.com/forum/?fromgroups#!topic/instagram-api-developers/QyjCORkjr3I

+7
source share
1 answer

I found 2 tips that may be useful to you:

  • You must use min_id to get new media. max_id will return photos older than those that have this identifier.
  • Better use the live API to dynamically update your database with new photos.

UPDATE:

Instagram API is now deprecated. However, now you can use the web host subscription system, which is very similar to facebook. Details can be found in this answer.

+4
source

All Articles