1
votes

I am just starting to learn both cloudinary and node JS and I'm not sure why I'm unable to override the default limit of 10 images returned by the api resources_by_tag. Since there are no examples of how to call the optional parameters in the documentation for node JS (that I could find at least), it's quite possible that I have something wrong in the API syntax:

cloudinary.api.resources_by_tag('myTag', (pictures) => {
  // do something with pictures
},
  {
    max_results: 100,
  });
1
Tried your code with several max_results values and it seems to be working. Is it possible that you don't have more than 10 images with the specific tag? It can explain why you're only getting 10 or less images. - Maor.G
I double checked and confirmed that I have 40+ images with my particular tag, ran my code again without touching anything and have all images returning. I can't explain what the difference is, but thanks for posting and making me try it again. - Daniel

1 Answers

2
votes

This was provided by Cloudinary technical support as the official syntax:

cloudinary.api.resources_by_tag("mytag",
function(result){}, { max_results: 500 });

It appears that my previous code in ES6 also works when I do more testing:

 cloudinary.api.resources_by_tag('myTag', (pictures) => {
  // do something with pictures
},
  {
    max_results: 100,
  });