Pomax / node-flickrapi

A node.js (and client-library) implementation of the Flickr API with oauth API key authentication and API method proxying
177 stars 52 forks source link

Returned photo results are insufficient, photo property only contains five photo objects when there are clearly more photos #97

Closed mikuya707 closed 7 years ago

mikuya707 commented 7 years ago

With correct authentication, upon calling

flickr.photos.getContactsPhotos({
  api_key: "XXXXXXXXXXX",
  count: 50,
  extras: "original_format"
}, function(err, result) {
// result is Flickr's response
    var photos = result.photos.photo;
console.log('photos result', result);
  photos.forEach(function(photo){    
    var url = "https://farm" + photo.farm + ".staticflickr.com/" + photo.server + "/" + photo.id + "_" + photo.originalsecret + "_o.jpg";;
    console.log('url is', url);
    download(url, date + "_" + photo.id + ".jpg", function(){
          console.log('done');
          });

      // console.log('what are sizes of photos', original);
  })

The photo result is print in console as below:

photos result { photos:
   { photo: [ [Object], [Object], [Object], [Object], [Object] ],
     total: 5,
     page: 1,
     per_page: 50,
     pages: 1 },
  stat: 'ok' }

In this case, there is only one contact, and the contact clearly has more than 10 pages of photos available, why is it only returning 5? I have also tried calling other methods like getPhotos, etc, they all returned 5 in total. Is there a parameter needs to be set in order to receive correct result or something is wrong here? Please advise.

Pomax commented 7 years ago

What happens if you try the same parameters on Flickr's online API test for this function call, https://www.flickr.com/services/api/explore/flickr.photos.getContactsPhotos ?

mikuya707 commented 7 years ago

@Pomax It returns the same results, only 5 photos.

Pomax commented 7 years ago

if the official API route returns the same result, then there isn't much I can do; the flickr.com tests are basically "what Flickr thinks you should get" so if this library and the official end test yield the same result, there's nothing I can do (the API processing is autogenerated off of the official API spec, so I can't tweak individual calls).

This might be a case of needing to figure out which arguments Flickr needs for your specific search to get the results you need (possibly involving a different API route)