Skip to content

Instantly share code, notes, and snippets.

@shankar-bavan
Last active April 19, 2022 07:01
Show Gist options
  • Save shankar-bavan/ce06aeb5c730573e1c89527971d253f8 to your computer and use it in GitHub Desktop.
Save shankar-bavan/ce06aeb5c730573e1c89527971d253f8 to your computer and use it in GitHub Desktop.
instagram feed with PHP
$instaResult = file_get_contents('https://www.instagram.com/'.$username.'/?__a=1');
$insta = json_decode($instaResult);
$instagram_photos = $insta->graphql->user->edge_owner_to_timeline_media->edges;
//view with foreach loop.
<ul>
@foreach($instagram_photos as $instagram_photo)
<li>
<img src="{{$instagram_photo->node->display_url}}">
</li>
@endforeach
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment