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
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025