Introduction
In this blog, I will demonstrate how you can stream Instagram photos directly to your website. When you post new photos and videos to Instagram, the script will automatically update with the new content.
First, do the following steps
1. Log in to your Instagram account
2. Get your Instagram access token. http://instagram.pixelunion.net/
HTML code to display Instagram photos
- <div class="container">
- <!--display instagram photos-->
- <ul id="InstaFeed"></ul>
- <!--#END# display instagram photos-->
- </div>
Javascript code
- $(document).ready(function() {
- var token = ""; //your access token here. Visit http://instagram.pixelunion.net/ to get your access token
- num_photos = 20; //limit number of photos
- $.ajax({
- url: 'https://api.instagram.com/users/self/media/recent',
- dataType: 'jsonp',
- type: 'GET',
- data: { access_token: token, count: num_photos },
- success: function(data) {
- console.log(data);
- for (x in data.data) {
- $('ul').append('<li><a target="_blank" href="' + data.data[x].link + '"><img src="' + data.data[x].images.low_resolution.url + '"></a></li>');
- }
- },
- error: function(data) {
- console.log(data);
- }
- });
- });
Thanks for reading!

Mohammad KhosrotabarPosted Jan 24, 2022, 9:27 AM
Is there any way to share url to instagram feed using javascript?
Yaseen MasthanPosted Aug 20, 2020, 4:13 AM
Can I get an instagram api which helps me fetch instagram data of any user?
Sagar ChaturvediPosted Dec 5, 2019, 4:24 AM
Nice. It will help me.
Sagar PardeshiPosted Nov 8, 2019, 1:29 AM
Good Explore social API Using Javascript keep it up