Instagram tag search - filter for images and tags after a specific time or identifier

I use the Instagram API to get a list of photos tagged with a specific hashtag. I have a real-time subscription, so it will notify me when new photos are published. However, I have to get new results myself.

My problem: when I request a list of recently flagged photos, I get a large list, and I don’t want to process all the results in the last list every time I do it. Api docs say that I can pass these optional parameters, but they seem inconsistent. They seem to be the opposite of what I expect:

MIN_ID  Return media before this min_id.
MAX_ID  Return media after this max_id.

If I keep track of the most recent media identifier that I have seen in my recent queries, how can I build the next query to return results newer than this id?

I posted two photos with a test hashtag. When I use the following url (with my real access_token in it), I return a json response that lists both of these photos:

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

Two photos have the following identifiers:

221201236060507271_179249322
221190263853517857_179249322

How to create a query that returns only the newer of the two photos?

+5
source share
1 answer

Mark the most recent identifier that you saw at the end using the query parameter MAX_ID:

https://api.instagram.com/v1/tags/weirdtest/media/recent?access_token=xxx&MAX_ID=221201236060507271_179249322

Instagram, * " , , 221201236060507271_179249322, " *.

+3

All Articles