{"id":2558,"date":"2024-12-31T20:23:00","date_gmt":"2024-12-31T20:23:00","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/magento-2-api-get-product-by-sku\/"},"modified":"2025-04-24T09:40:39","modified_gmt":"2025-04-24T04:10:39","slug":"magento-2-api-get-product-by-sku","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/magento-2-api-get-product-by-sku\/","title":{"rendered":"Magento 2 API &#8211; Get Product by SKU"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello, Magento peeps!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">My last blog post on&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/magento-2-api\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 API<\/a>&nbsp;was all about how to get all products using API. In case you missed it, you can read it at&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/magento-2-api-get-all-products\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 API \u2013 Get All Products<\/a>. In this post, I will show you how to get product by SKU in Magento 2 API.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are developing a third-party Magento 2 application or mobile app, you may require to fetch the information about specific products through SKU. The&nbsp;Magento 2 API Get Product by SKU&nbsp;makes it possible to fetch the product information from Magento to display it on the product page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Read this complete blog post to understand how you can get product by SKU Magento 2 API.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s begin!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Get Product by SKU Using Magento 2 API?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In order to fetch the products by SKU using Magento 2 rest API, the client needs to make a GET call to the&nbsp;<em>store_url\/products\/&nbsp;<\/em>with the SKU in the path variables. Magento, in response to the request, will return all the information and attributes of the products.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Method:&nbsp;<\/strong>GET<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>URL:&nbsp;<\/strong><em>store_url\/products\/:sku<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Params(Path Variables):<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Key:&nbsp;<\/strong>sku<\/li>\n\n\n\n<li><strong>Value:&nbsp;<\/strong>&lt;the sku of the product&gt;<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2022\/05\/Get-Product-by-SKU-in-Magento-2-API-700x401-1.png\" alt=\"Get Product by SKU in Magento API\" class=\"wp-image-50786\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Response:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On sending the Magento 2 Get Product Attribute request with the SKU in the parameters, Magento returns all information about the respective product.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Fetching product information from Magento 2 through API is necessary if you are working on a third-party development based on Magento.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Magento 2 API \u2013 Get Product by SKU is necessary to fetch and show the updated product information on the product page. I hope this guide will add value to your Magento 2 API skills.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In case you still have any doubts or queries, feel free to comment. I\u2019d be happy to help you. \ud83d\ude07<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also, do not forget to share this post with your Magento friends via social media. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks for reading! \ud83c\udf40<\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-nowrap is-layout-flex wp-container-core-buttons-is-layout-21295d6f wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button btn-orange\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/meetanshi.com\/blog\/magento-2-api-get-all-products\/\">Magento 2 API \u2013 Get All Products<\/a><\/div>\n\n\n\n<div class=\"wp-block-button btn-orange\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/meetanshi.com\/blog\/magento-2-api-searchcriteria\/\">Magento 2 API \u2013 SearchCriteria<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Hello, Magento peeps! My last blog post on&nbsp;Magento 2 API&nbsp;was all about how to get all products using API. In case you missed it, you&#8230;<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-2558","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=2558"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2558\/revisions"}],"predecessor-version":[{"id":12889,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2558\/revisions\/12889"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=2558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=2558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=2558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}