Fetch all products with a specific tag via API?

jfigure
New Member
3 0 0

Currently I have two storefronts. 

Store one was not built by me, but the source is very clear and easy to understand. There is an AJAX call being made to

https://www.store1.com/collections/all/<tag_name>?view=json

Obviously <tag_name> is the specific tag I'm looking for. This works beautifully and returns a json object with all the data needed. If you visit the url in the browser you'll see the json. 

Store two that I'm currently building if I do the same exact thing... I am returned a collection page with products with that tag. It will not return JSON like store one. I can't find any reason for this behavior. Shopify support said store one might have a cookie causing this behavior, but that's not the case. 

If anyone can explain the different behavior, I'd be very grateful- or if there's a better way to make this AJAX call I'm open to that. 

0 Likes