Currently I am calling Instagram API to get media with a certain #hastag. To make this process as efficient as possible and reduce calls to the API, data is cached on the server.
The purpose of this is to display some of the posts randomly on a website, but to respect the users privacy and Instagram rules, we need to get rid of the cached posts if it has been removed from Instagram.
The way I'm retrieving the media right now is calling the recent media endpoint for this tag each time my subscription alerts my app that there are updates.
So basically I need an efficient way to know if a post has been removed from Instagram, so that I can immediately remove it from my cache. I realize this can be done with a large number of calls to the API, but that's not ideal.
The API can be used to get and publish their media, manage and reply to comments on their media, identify media where they have been @mentioned by other Instagram users, find hashtagged media, and get basic metadata and metrics about other Instagram Businesses and Creators.
When you save any of the original image/video url's you could periodically check whether this image still exists. If not, it's probably safe to assume that the original post has been removed. This way multiple API calls, are replaced by even more datacalls, but it should be a lot faster and no limits are enforced.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With