URL signature expired error when viewing Instagram images from Instagram API

Viewed 26213

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/x.x.x.x/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.

2 Answers

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.

Related