Get Instagram image data using javascript/jquery
var token = '<access_token>',
userid = '<user_id>', // User ID - get it in source HTML of your Instagram profile :)
num_photos = 4; // how much photos do you want to get
$.ajax({
url: 'https://api.instagram.com/v1/users/' + userid + '/media/recent', // or /users/self/media/recent for Sandbox
dataType: 'jsonp',
type: 'GET',
data: {access_token: token, count: num_photos},
success: function(data){
console.log(data);
},
error: function(data){
console.log(data); // send the error notifications to console
}
});
var token = '<access_token>',
hashtag='<tag>', // hashtag without # symbol
num_photos = 4;
$.ajax({
url: 'https://api.instagram.com/v1/tags/' + hashtag + '/media/recent',
dataType: 'jsonp',
type: 'GET',
data: {access_token: token, count: num_photos},
success: function(data){
console.log(data);
},
error: function(data){
console.log(data);
}
});