Access product json by title

Shopify Partner
5 0 1

How can I grab a product json using its title instead of id 

ex

By ID: /admin/products/#{id}.json
By Title: /admin/products/#{title}.json
0 Likes
Shopify Partner
1361 21 195

You can get it by the product handle, witch is easy to get from the title

GET /products/<product-handle>.js

https://docs.shopify.com/support/your-website/themes/can-i-use-ajax-api#get-product

https://sections.design tips, tricks & Shopify sections
0 Likes
Shopify Expert
9981 85 1492

The above is great example of using the AJAX api, but if this is for an app you must use an ID. Refer to the API docs for the endpoint.

https://docs.shopify.com/api/product#show

I am curious - why do you need to access the product by title?

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Shopify Partner
5 0 1

I need to access the product by title because I have the title as a string and its the only thing I can use to access more information from the product.

1 Like
Shopify Partner
1361 21 195

Get all products, do a loop and match the title. More expensive though

https://sections.design tips, tricks & Shopify sections
0 Likes
Highlighted
Shopify Partner
5 0 1

Yea thats what I am trying to avoid

0 Likes