简体   繁体   中英

URL signature expired error when viewing Instagram images from Instagram API

I am getting the instagram images from instagram API. (endpoint : https://api.instagram.com/v1/users/self/media/recent?access_token= ). Then I am saving the image URLs that returning from the API call in the database and use them in the front-end. Exmple image url is below.

Example URL : https://scontent.cdninstagram.com/vp/xxx/xxx/xx/s150x150/xxx/xxxx/xxxx_n.jpg

But sometimes the images doesn't show and when I go to the image particular link it shows 'URL signature expired'. What would be the reason for that?

I have referred the question about the same in a previous post in stack overflow and it didn't help. It said to save the image in a separate server. It won't work for me.

Instagram CDN URLs contain timestamp components that allow them to expire after a while. If you need the image to persist, you'll have to save it somewhere and serve that instead.

You can visit https://www.instagram.com/p/CQX8lKutaZU/media/?size=l

Use; "l" parameter for large,

"m" parameter for medium,

"t" parameter for small pictures.

But sadly it doesn't work on videos (it just shows thumbnails)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM