First of all: you can increase the multimedia limit to 33 photos. You should use the count parameter in your query:
https://api.instagram.com/v1/tags/nofilter/media/recent?count=33&access_token=YOUR_ACCESS_TOKEN
, , Instagram .
API- Instagram:
MIN_TAG_ID Return media before this min_tag_id.
MAX_TAG_ID Return media after this max_tag_id.
, 3 ( id # 1 id # 100):
:
next_min_id
photo
photo
photo
...
photo
next_max_tag_id
:
next_min_id
photo
photo
photo
...
photo
next_max_tag_id
:
next_min_id
photo
photo
photo
...
photo
next_max_tag_id
querystring max_tag_id , min_tag_id . , min_tag_id , , min_tag_id . (# 1, # 2, # 3...) min_tag_id (# 34 # 67) .
, querystring max_tag_id next_url ( URL- - ).
max_tag_id ( ) . :
var token = "<your_access_token>";
var nextURL = "https://api.instagram.com/v1/tags/riodejaneiro/media/recent?count=33&access_token=" + token;
var currentPage = 0;
var pages = new Array();
$(function() { requestInstagram(); });
function previousPage() {
currentPage = (currentPage>0) ? currentPage-1 : 0;
console.log("Page " + currentPage);
console.log("First photo:" + pages[currentPage][0].id);
}
function nextPage() {
if (++currentPage < pages.length ) {
console.log("Page " + currentPage);
console.log("First photo:" + pages[currentPage][0].id);
} else {
requestInstagram();
}
}
function requestInstagram() {
$.ajax({
method: "GET",
url: nextURL ,
dataType: "jsonp",
context: this,
success: function (r) {
if (r.meta.code == "200") {
pages[pages.length] = r.data;
console.log("Page " + currentPage);
console.log("First photo:" + pages[currentPage][0].id);
nextURL = r.pagination.next_url;
console.log(nextURL);
}
}
});
}
!