Reputation: 23
I've been searching everywhere for the last two days but haven't seen any solutions to this problem. I'm new to javascript and working with APIs and thought it'd be fun to dive in and make a calendar on my personal site that gets populated with photos from my Instagram account with a particular tag.
I use the proper request url and even started adding on a count for the hell of it:
var url = 'https://api.instagram.com/v1/tags/' + tag + '/media/recent?access_token=' + accessToken + '&count=100';
$.ajax({
url: url,
dataType: 'jsonp',
type: 'GET',
success: function (data) {
console.log(data);
},
Going in I understood that I'd probably get around 20 results back as that was the max and was alright with that. However, no matter what I do I only get 16 results back.
I even went in and added a unique tag to the last 30 photos I wanted to show and changed the url to use it, but I still only get the last 16. Is this a new limit? I'm working in sandbox mode but nowhere on the internet do I see anyone else getting this specific result.
I'm also still struggling to figure out how to get pagination to work as that doesn't seem to do anything, even if I hand grab the min_tag_id from the first results and do
url: url + '?min_tag_id="' + minTagId + '"',
Upvotes: 1
Views: 257
Reputation: 8366
Since Nov. 17 2015 Instagram made some changes to their API. Apps will start in Sandbox Mode and function on newly updated API rate-limits and behaviors. Data is restricted to sandbox users and the 20 most recent media from each sandbox user. https://instagram.com/developer/
Upvotes: 1
Reputation: 23
After rereading the docs, it seems like they're saying only the most recent 20 of my photos exist. I thought that meant only 20 could be reached at a time but they mean literally the last 20 I took exist, regardless of their tags.
4 of my latest photos are not a part of this series as they don't have the right tags, but they are being counted in my 20 photos. So there we have it.
Upvotes: 1
Reputation: 12952
Just use the pagination.next_url
it is the easiest way to get next set.
If not get the id
of the last photo in previous API call and use it as max_tag_id
(not min_tag_id
)
You only get maximum of 20 per call, if there is no pagination.next_url
then there are no more photos. Login and check on http://www.gramfeed.com/instagram/search, to see if u get same results.
Upvotes: 0