Search code examples
instagraminstagram-api

Instagram min_tag_id stoppes working


I've been using Instagram's min_tag_id for a while now without any major problems. Recently I realized that I stopped getting new content after a while.

For example when looking for tags/chicken/media/recent the first time, I get a bunch of posts and a min_tag_id like AQC8xyA5c5TTZycztD0Y3pb5ECQ7BbDUN-UPvGeN_ki-rroC3YbV4UH9Hr44UK4cAaKfRb5e1hWCyYqECiMiwG2XUnP5-6-F8MW7jCPSMZIgVqbPn9_HIZyhtOT3isPopSU.

I store this min_tag_id in a database and use it few seconds later to make a new request to the API - to get new content.

But somehow, after some time, Instagram won't deliver me new content anymore.

Then I have to delete the last min_tag_id and make a new request without it. Instagram will of course respond with a bunch of posts I already know, but also with a new min_tag_id which will work again for some time.

I cannot reproduce the problem just yet, it just happens. Sometimes it takes a few hours, sometimes it seems to be a few days.

Does anyone know why this is happening or even have a solution that does not include deleting the old min_tag_id sporadically?


Solution

  • I found the error I made. I only stored the min_tag_id when there was content delivered by Instagram. But when there where no new posts, I considered the request as "not successful" and didn't care to store the new min_tag_id.

    Instagram sends a freshly generated min_tag_id for every request, regardless if there is new content or not. One always has to use the new min_tag_id, even though the "old" id still works for a while. Apparently the "old" min_tag_id will expire at some point.