I am getting images from instagram using following code but today images are not displaying and path created from this api is not working , path is below https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/s150x150/e15/11055912_1557024864574301_1391428754_n.jpg
<?php
$feed_url = "https://api.instagram.com/v1/users/testuser/media/recent/?access_token=mytoken";
$response = json_decode(@file_get_contents($feed_url), true);
$feeds = $response['data'];
?>
<div class="row instagram-body">
<?php
if(!empty($feeds)){
foreach ($feeds as $feed)
{
$instagram_link = $feed['link'];
$image_link = $feed['images']['thumbnail']['url'];
$caption=$feed['caption'];
if(empty($caption))
{
$description=null;
}
else
{
$description=$caption['text'];
}
?>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 imageholder">
<a href='<?php echo $instagram_link; ?>' class="instagram-image"><img src='<?php echo $image_link; ?>' class="img-responsive borderimg"/></a>
<div class="thumbnail-share">
<div class="facebookshare-insta" onClick="shareFacebook('<?php echo $instagram_link;?>')">
</div>
<div class="twittershare-insta" onClick="shareTwitter('<?php echo $instagram_link;?>','<?php echo $description;?>')"></div>
</div>
</div>
<?php
}
}
?>
</div>
Your code works just fine. I was able to test it at my side and I could see images from my account (replacing 'testuser' in url with 'self' and using my access token).
Since I was also able to access the image from the link you provided, it's possible that, when you ran your code, there was some network issue (e.g. DNS propagation delay) that prevented image access at that time from your location.