Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding min_tag_id and max_tag_id

tag_media_recent takes as max_id and min_id as parameters.
The documentation says :
MIN_ID Return media before this min_id.
MAX_ID Return media after this max_id.

I tried max_id = 3390883111979 (very large than what is currently used)
It returns the newest tagged images. Doesn't it follow the definition of min_id? seems erraneous

I also tried min_id = 1390922265529 and max_id = 1390922265528. It returns 12 images. How is that possible when the max range given is 3?

I also tried reversing the values used in min_id and max_id. Still 16 images.....

Could not make out anything from min_tag_id and max_tag_id...

Anybody got any answer ??

like image 710
Ankit Nayan Avatar asked Jan 28 '14 07:01

Ankit Nayan


1 Answers

I think you are asking generally how min_tag_id and max_tag_id work. (I know this question is stale but hopefully this helps someone)

So it is confusing the way Instagram has labeled these:

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

The definitions of "before" and "after" are from the perspective of pages of media, in which the first page is newest media and the last page is oldest.

Instagram named things with the next query in mind, I guess. So if you query for recent media and the response has a "min_tag_id" of 1234, that is actually the high id mark in the response (what you would hope would be named 'max_tag_id'). That min_tag_id is what you would use to get newer media, next time you query. Likewise, the max_tag_id is what you would want to search up to, if you want to page through to older media.

For instance, you may notice that 'next_url' in the response is simply another query with 'max_tag_id' parameter set to that response's max_tag_id. http://instagram.com/developer/api-console/

Hope that adds some clarity.

like image 133
jbarr Avatar answered Jan 19 '23 11:01

jbarr