Answer the question
In order to leave comments, you need to log in
What is the right way to get posts (feed) on instagram now?
Here is an example request:
const userID = 2879996464;
jQuery.ajax({
url: 'https://api.instagram.com/v1/users/' + userID + '/media/recent',
dataType: 'jsonp',
type: 'GET',
data: {access_token: tok, count: kolichestvo}, // передаем параметры, которые мы указывали выше
success: function(result){
console.log(result);
for( x in result.data ){
jQuery('.new_list').append('<li><div class="img"><a href="'+result.data[x].link+'" target="_blank"><img alt="" src="'+result.data[x].images.low_resolution.url+'"></a></div><div class="links"><span class="like">'+result.data[x].likes.count+'</span><span class="comment">'+result.data[x].comments.count+'</span></div></li>');
// result.data[x].images.low_resolution.url - это URL картинки среднего разрешения, 306х306
// result.data[x].images.thumbnail.url - URL картинки 150х150
// result.data[x].images.standard_resolution.url - URL картинки 612х612
// result.data[x].link - URL страницы данного поста в Инстаграм
// result.data[x].likes.count - likes count
// result.data[x].comments.count - comments count
}
},
error: function(result){
console.log(result);
}
});
{"meta": {"code": 400, "error_type": "OAuthAccessTokenException", "error_message": "The access_token provided is invalid."}}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question