How to get the list of tags, which exist in my cloud?

Comments

7 comments

  • Avatar
    Aditi Madan

    Hi,

    From the client-side you can view the list of images by tags by accessing the endpoint: https://res.cloudinary.com/<cloud name>/image/list/<tag name>.json

    From server-side there are multiple ways to view images based on the tags:

    - Admin API: You can use get_resources_by_tags method. More information here: https://cloudinary.com/documentation/admin_api#get_resources_by_tag

    - Search API: You can pass the tag inside the expression when using the search API. More information here: https://cloudinary.com/documentation/search_api

    Thanks,

    Aditi

    0
    Comment actions Permalink
  • Avatar
    Digital.Interdan

    Hi Aditi, thanks for you response, but it is not quite what I am looking for...
    I know how to retrieve resources based on a tag(s), but I would like to be a able to list all possible tags, which exist in my cloud

    So, for example a user can select one of existing tags from multiselect, like in the console

    Is there any possible way to get a list of all the tags from my cloud through the Admin API?

    0
    Comment actions Permalink
  • Avatar
    Aditi Madan

    Currently, we don't have a way to list tags in the account. I will raise a feature request for our product team to consider adding it in the future.

    Thanks,

    Aditi

    0
    Comment actions Permalink
  • Avatar
    Toma

    Hello Aditi,

    This issue has recently become relevant for me. I need to list all the tags available on my cloud. Has the function been implemented in the API?

    Thanks

    0
    Comment actions Permalink
  • Avatar
    Thomas Gurung

    Hi Toma,

    Thank you for reaching out.

    We do have an API to get all your tags, click here. Just note that by default the resource_type is image so you will need to specify `resource_type:video`/`resource_type:raw` for video/raw assets.

    Please let me know if you have any other questions.

    Kind Regards,
    Thomas

    0
    Comment actions Permalink
  • Avatar
    Toma

    Thomas, 

    Thanks for replying. I found this URL in postman (I'm using the API by making requests to URLs, rather than calling methods). This endpoint below requires API credentials and extra setup on my part, I was looking for URL that would only expose my cloud name.

    https://api.cloudinary.com/v1_1/<cloud_name>/tags/image
    0
    Comment actions Permalink
  • Avatar
    Thomas Gurung

    Hi Toma,

    Thank you for getting back. 

    Unfortunately, we do not have a public API URL which would expose all the tags in your account currently. You could use the curl method described here and this should quickly give you all the tags in your account.

    curl https://<API_KEY>:<API_SECRET>@api.cloudinary.com/v1_1/<CLOUD_NAME>/tags/image

    When a request has more results to return than max_results (max_results can be set to a maximum of 500), the next_cursor value is returned as part of the response. You can then specify this value as the next_cursor parameter of the following request.

    Another way to get your tags would be via our CLI SDK which should take minimal time to set up, see this link. Then you can just run `cld admin tags max_results=500`. I would recommend this way as it is secure and does not expose your API secret. 

    If you need to get the tags for your app then calling this API via a backend server is the best method as we do recommend exposing your API secret on the front-end.

    Please let me know if you have any other questions or queries.

    Kind Regards,
    Thomas

     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.