Skip to main content

How to list by multiple public IDs via the Admin API



  • Bharat Nanwani


    Can you please help with an example to use resourcesByIds using Java Library please?

    I'm stuck on it for days now.

  • Nadav Ofir

    Hi Bharat,

    Here's an example from the Admin-API documentation (click the Java tab on the widget):

    Does it help?

  • Ryan Suntoucher

    Hi Cloudinary Support, 

    Is there a way to bulk list resources? I know that I can pass up to 100 public_ids in a single API call, but is there a way to use a next_cursor or something similar to get resources_by_ids in excess of 1000 public_ids? I'm writing a script which would update the Avatar of all users but have been road-blocked by the 100 public_id limit. If I loop through an perform an API call per user I hit the Cloudinary API rate limit of 500 transactions per hour. Any suggestions? 

  • Shirly Manor

    Hi Ryan,

    Here is more information of how to list all your resources using next_cursor and checking the API rate limit.

    Please let me know if that works for you


  • Ryan Suntoucher

    Hi Shirly, 

    Thanks for your reply. Actually rather than just browsing all resources I am looking to get information from Cloudinary about a large group of images used as Avatar images for users. 

    ```if user.avatar?
        cloudinary_public_ids << user.avatar.public_id # this returns hundreds of results

    Cloudinary::Api.resources_by_ids(cloudinary_public_ids) # should return has of info about these resources

    # results in error because .resources_by_ids only allows 100 public_ids at a time

    I however found a work-around for this by using the Ruby API method ``` .in_groups_of(n)``` which would then allow me to break my array of public IDs into chunks and get my resources that way.

    ```cloudinary_public_ids.in_groups_of(100) do |cpi|
        cpi.each do |p_ids|
            results << Cloudinary::Api.resources_by_ids(p_ids)

    I ended up finding a solution which didn't require making any API calls to get the necessary information, but I'm hoping this helps someone else who is trying to do something similar. 


  • Shirly Manor

    Thank you Ryan for sharing your code with Cloudinary community!


Please sign in to leave a comment.