search API subfolder

eemeals Member Posts: 1

Hi! I am new to Cloudinary so bear with me... Right now the following code grabs all of my Cloudinary media, but I just need assets from a folder/subfolder. How can I specifically grab assets within a particular folder using the Cloudinary search API? Thanks!

const results = (await

  .expression(`resource_type: image`)

  .sort_by('public_id', 'desc')





  • Cloudinary Team
    Cloudinary Team Administrator, Cloudinary Staff Posts: 135 admin

    Hi there,

    Thanks for reaching out.

    You can use the 'folder' expression field to get the assets in a particular folder. Here is an example of querying for assets in a folder called 'cats':"folder=cats").execute().then((result) => console.log(result));.catch((err) => console.log(err));

    You can refer to the documentation for additional information on expression fields here:

    I hope this helps. Please give it a try and let us know if you have any questions.
    Kind regards,


    Helpful Links For You
    💬 Share questions, connect with other users in our Cloudinary Community forums and Discord server!
    🧑‍🎓 Join our Cloudinary Academy for free courses, workshops and other educational resources.
    📄 Read our documentation for in-depth details on Cloudinary product features and capabilities
    📰 Check out the Cloudinary blog for the latest company news and insights