App reviews, troubleshooting, and recommendations
Hello Is there any API exist to get product details like price by productID ?
Hi @masumluf ,
Hope you are doing well.
You can use the below mentioned API to fetch the product details using product id.
https://shopify.dev/api/admin-rest/2022-04/resources/product#get-products-product-id
Please mark it as a solution and leave a like if you find it helpful.
Cheers!!
Shubham
My api request will come from a store front , so I can not generate access token , i need to call another api to generate api token. so this method wont help me. but I found a solution in another way.
That is great!
Could you share that solution here as well so it will help others who might need it? 🙂
Use the below code to get the product information by product id
{% assign product_id = param | times: 1 %}
{% assign products_obj = collections.all.products | where: 'id', product_id %}
{% assign product = products_obj[0] %}
Where param is your product id. Let me know if that's work for you
This method is limited to 50 iterations, therefore it will only check for the 50 first products of the collection. In other words: it might not work.
I think you could still do:
{% paginate collections.all.products by 1000 %} {% assign product_id = param | times: 1 %}
{% assign products_obj = collections.all.products | where: 'id', product_id %}
{% assign product = products_obj[0] %} {% endpaginate %}
But this is a "trick" and if the collection starts to get too big this could make performances worst, so use with caution.
Yes please share the solution you found
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025