skip to Main Content

I am trying to get single product json by product id

https://testbydisnap.myshopify.com/products.json?product_id=10282991814

OR

https://testbydisnap.myshopify.com/products/drummer-tshirt.js

replace with

https://testbydisnap.myshopify.com/products/10292902662.js

Any solution?

Thanks

2

Answers


  1. You’ll want to use .json at the end of the URL. Your last example was close!

    Correct url would be GET https://testbydisnap.myshopify.com/products/10292902662.json

    If you want to do it via Javascript on the frontend of the site:

    jQuery.getJSON('/products/a-b-c-d-e.js', function(product) {
      console.log('The tags for this product are ' + product.tags);
    } ); 
    

    The tags for this product are test1,test2

    Login or Signup to reply.
  2. For getting product json for a single product based on its id, you could simply use:-

    https://testbydisnap.myshopify.com/admin/products/product-id.json

    You can test this url from browser by passing product-id. It will show product information in JSON format.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search