Access product json by title

Andy_I_T_
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
Mircea_Piturca
Shopify Partner
1485 42 309

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

Finally—Add variant descriptions to your products
0 Likes
Jason
Shopify Expert
10277 144 1945

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?

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
0 Likes
Andy_I_T_
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.

Mircea_Piturca
Shopify Partner
1485 42 309

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

Finally—Add variant descriptions to your products
0 Likes
Andy_I_T_
Shopify Partner
5 0 1

Yea thats what I am trying to avoid

0 Likes
TuanNguyen
New Member
2 0 0

How to set anyone can't access product json by title ?

0 Likes