Anybody knows how to fix as issue with expired instagram media links ?
Im parsing media and after a few days/weeks/hours the links are expired.
Maybe there is a way to use this links or fix somehow?
I had the same issue and this is how I solved it, in the instagram media api you can fetch the perma_link like https://www.instagram.com/p/Bt3QrphggBw/. Just add
https://www.instagram.com/p/Bt3QrphggBw/media/?size=m. It will redirect to the proper image url.
All of the media links generated by instagram have timestamp components in them, ie. those links have an expiration time (not sure exactly how much but all of the links expire after some time). The workaround is either to keep refreshing the links by calling instagram api or to store the images somewhere and use that link.
Related
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.
I have one question, with an Instagram Username. Can I get back data from that user? for example, get photos and number of followers? (only if profile is public)
I'm creating a website were users can upload their Instagram username #example and based on that scrap and create a profile on the website with their latest photos and the number of followers (all of this without logging).
I think This image will help to understand what I'm trying to achieve, Can someone guide me? this is possible with Instagram API?
Yes this was possible recently with https://www.instagram.com/<username>/?__a=1 but instagram recently blocked this possibility.
I'll update my post if I find a new method.
All I want to do is show the most recent of our client's Instagram posts on the website we are building for them.
This was possible using only their ClientID until November 2015, but Instagram seem to have made it so that we have to get users to log in so we can get an access token to use in the API call.
This seems nonsense and I can't help feeling I'm missing something simple. I should be able to display client's content on their website without viewers of the site having to log into Instagram!
There are a number of solutions on Stack Overflow, but all the ones I've found pre-date Nov. 2015.
Use your own access_token.
Get it one time, save it and use it, it is not eternal though. I have the same problem.
Recently, I wrote an app to synchronize photos in my Instagram to another platform. The GET /v1/users/self/media/recent?access_token=ACCESS_TOKEN result should contains the links to my pictures, like
https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/s640x640/e35/sh0.08/11330602_751572388302808_972254350_n.jpg,
and it went very well. But today after clicking the link, it told me Invalid Request. I'm not sure what happened to this cdn link. Any hints would be appreciated.
When you open the Instagram APP you can look at your news feed where you can see that someone is now following you, likes or has commented on a certain photo.
When I look at the Instagram API (http://instagram.com/developer/) I can retrieve likes and comments when I request a certain media ID. However in order to know if someone has commented on a photo of mine I would need to scan all the photo's and request it's comments to check if any new comments have been made.
Does anyone know of a better way? Help is appreciated.
If it helps, content for "Following" tab is available at http://instagram.com/api/v1/news/, and "News" tab at http://instagram.com/api/v1/news/inbox/ (you need to be logged in to your account).
All URLs point to internal instagram:// protocol so you would need to replace them when parsing and there seem to be no pagination options.