Is there an API that simply returns a list of unique Tags for a Shopify site?
We are building an app and we would like to display a list of pre-existing tags used on the site.
This seems like it would be really useful and should be made availble. Any ideas or suggestions would be greatly appreciated.
Thanks for the suggestion. However, can you please explain further? I don't understand how to apply your suggestion. To clarify, I am not trying to return the tags on a single product. Rather, I am trying to return ALL unique tags for the entire site.
Below is some PHP code that I use to get Product information leveragin this API: https://docs.shopify.com/api/reference/product
$sc = new ShopifyClient($store_name, $access_token, SHOPIFY_API_KEY, SHOPIFY_SECRET); $URL = "/admin/products.json"; $tags = $sc->call('GET', $URL, "");
Currently, I loop through the entire product catalog and create an array that holds the unique Tags for the site. However, if a shop owner has 5,000+ products then it becomes really slow. What I am hoping exists, is an API call that says: Get all unique tags for the site.
Is it possible?
You could try the collection approach. Since a collection.tags returns all the tags of all the products in the collection, you'd benefit.
The comment about it being SLOW when you have 5000+ products is ridiculous. 5000 products is 20 API calls, and a small batch like that can happen in mere seconds. Who has sympathy for someone calling a few seconds too slow for an algorithm that quite frankly is not even real-time, but can happen once, slowly, and whenever? Once you iterate all products, you have all tags. Done.