Instagram min_tag_id stoppes working - instagram

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?

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.

Related

Video URLs from Instagram API Expire and break after a short period of time

After a short timeframe, Instagram updates the image URL and the one they give you becomes expired. It isn't a scheduled thing so it isn't something you can refetch on a schedule to fix. The URL you have may break at any time. Has anyone found a solution to easily retrieve an Instagram video URL perhaps similar to the way that the linked solution fetches a current version of static images?
Here is an example of an expired URL that comes from the Instagram API:
https://video-iad3-1.cdninstagram.com/v/t50.33967-16/311796704_656982995824312_2200462786629368413_n.mp4?_nc_cat=100&vs=415717487387323_1550039796&_nc_vs=HBksFQAYJEdPQ2psUks0N2hiR2hWVUNBRjE2Z3ZJX25Za2VicV9FQUFBRhUAAsgBABUAGCRHRGw4alJKMmxkNUFBTU1CQU0wMG1qVU5adW9XYnFfRUFBQUYVAgLIAQAoABgAGwGIB3VzZV9vaWwBMRUAACb8mv6DgfHqQBUCKAJDMywXQBIFHrhR64UYEmRhc2hfYmFzZWxpbmVfMV92MREAdQAA&ccb=1-7&_nc_sid=59939d&efg=eyJ2ZW5jb2RlX3RhZyI6InZ0c192b2RfdXJsZ2VuLjcyMC5jbGlwcyJ9&_nc_ohc=nav3pTRz9T0AX-csieO&_nc_ht=video-iad3-1.cdninstagram.com&edm=AL-3X8kEAAAA&oh=00_AT9Wj2ue0CNOvRywTzAh2gvCxJl9Bhr1me4nIveXwZ2KNg&oe=634A481F&_nc_rid=6e1aabaa0c
This problem is specifically for Instagram Videos. The same thing happens to images and we are using the solution from this post: Instagram/feed API media URL shows 'URL signature expired' to fix static images and video poster images. But this doesn't work for video.
We've also tried the suggestions of using parameters ?__a=1 but it comes up as a broken page and does not return json as some have suggested.
Currently we are falling back to the poster image, but having the video would obviously be ideal.

Twitter API, reply tweets become unavailable

I am trying to post a thread on Twitter through my bot with nodejs. I can successfully post the tweets subsequently by replying to them and create a thread. I use npm twitter package.
I am checking from an external account if tweets are all ok. In the first few seconds it's all good. But when I refresh in less then a minute all tweets above and below a tweet become 'unavailable'. If I log in to the bot account I see tweets are available and connected to each other.
This is how it looks in the website
At first tweets are fine. But if I click it a minute later all tweets look like this
From the bot account, it's all fine
My reply function is as follows:
function reply(status, prevIdStr, username) {
return Twitter.post('statuses/update', { status: status, in_reply_to_status_id: prevIdStr, auto_populate_reply_metadata: true });
}
I also check if anything changes by comparing Tweet objects before and after. I really can't find a reason why this should be the case. Has anyone an idea why? Thanks.
I have no idea why, I ended up opening a new account. It started working
Edit: The reason it worked is that the previous account got marked as spam, because I was testing and excessively tweeting.
Creating a fresh account obviously solves the issue, or contact support to lift you suspension.
Edit 2: With a new account and without posting test tweets I encountered the same issue.... Still investigating.

Weird Issue With Instagram API

Issue:
First API calls only returns top 3 posts.
The next_url returns no data(data array is empty and pagination string is null)
The 4th post is suspect because I am unable to get it with API calls and it is not returned in the first API call.
Details:
Using v1/users/self/media/recent endpoint
Using Javascript to loop through calls, using "next_url" for the 2nd and subsequent call.
Using Access Token
Worked fine(returned all posts) until "the 4th post" was made
Why do I think one specific post is the issue? Because I am unable to retrieve it using the API. If I set the max_id to this post id, then I get all other posts before this post.
If I leave max_id out, the first call gets all posts newer than this post.
Verified that I am not in a Sandbox.
Has anyone encountered this before? and why would one post be breaking the next_url API call? Is there something in the post causing this?
I can't give out the IG account, sorry I know that would help, but it needs to remain private.
I am a developer on a project that makes extensive use of the legacy Instagram API. It has, for a long while now, been extremely flakey. We have experienced your exact issue many times and there is no practical solution.
However, all Instagram APIs have now (finally!) been migrated to Facebook. You should use the new Instagram Basic Display API which will be properly supported going forward.

basecamp 2 get trashed persons events

I am getting all the history from Basecamp and putting it into a database. However when I get everybody events history it doesn't include people who have been removed and are in the trashed folder.
I used "people/trashed.json" to get everyone who has been trashed. However when I put in their id like "people/userID/events.json" it comes back with nothing, I also tried "people/trashed/userID/events.json" but still nothing. On the api documentation (https://github.com/basecamp/bcx-api/blob/master/sections/people.md) it mentions how to get the people who are in the trashed part but not if it is possible to get their events history.
Does anyone know if getting a trashed persons event history is possible and if so how do you get it?
Thank you.
It seems it's not possible. I removed one user and invited him again, but the new user profile has different id. I also do not see an option to move user from trash.
My idea was to add user again to one, test project and delete again after fetching events.
You can try to ask Basecamp support about it.
The only way I have found to get the data is to go through every campaign and get their events. The events include ones from the people who are trashed. Also if you get the id's of the campaigns that are trashed you can still get the events off them, therefore it might be a bit tedious but you are able to get all of the events of trashed people this way.
Lets hope there is a better way in Basecamp 3.

Instagram real time api - manage to get only last uploaded images

I have real time subscription for really popular tag.
My app gets many subscription calls in second and then i am making post request to tag/media/recent, but i am getting duplicate and skipped images because it is very fast. How can i get sure that i request for image that subscription call is sent?
I tried even to set count to 1, and store last min_tag_id, but i am getting duplicates and missed images also.
my idea was to get last picture id, then on subscription call to set sleep for sometime and then call tag/media/recent with count=1 and min_tag_id and i will get picture for that subscription call, but there are still duplicates.
Why Instagram is not simply sending picture ids?
I have been having the same issue as you (working on this over the last week). My workaround, currently, is after Instagram sends a POST that an update for the hashtag has happened, I do a POST call for the most recent photos (currently setting count to 1 as you're doing but still working on getting all the newest photos).
I basically store all the latest photos returned in a database using the photos id as the primary key. If the key already exists in the db I issue an update otherwise the new photo gets inserted into the database. I then check whether an update was called or an insert was called. If an update, I simply exit the function. If an insert was called, I then issue a response to the browser with the new photo (this is very easy to do with web sockets; alternatively you can simply poll your database over a set interval to check if new photos were added).
I'm not even sure if this is a correct approach, it feels very hacky to me but Instagram's real time API is not very intuitive to work with.

Resources