Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Retrieve complete description of product via API

Retrieve complete description of product via API

Unkn3453_own
Shopify Partner
2 0 0

Hello to everyone,

I am currently using the (REST) Product API to retrieve some information about products.

I am also retrieving "body_html" which is just containing small information about the product and not the complete product description (as seen in the screenshot).

Is there a possibility to get those information trough Shopify API.

Screenshot and link are just for demonstration purpose:
https://snocks.com/products/retrosneaker


Thankful for every help!

Screenshot 2024-02-15 at 22.44.40.png

Replies 3 (3)

Liam
Community Manager
3108 344 909

Is all the description entered in as a usual product description (ie: you're not using extra content blocks on the product page or referencing metafileds? This might be easier to achieve with the GraphQL API which has a description field and a descriptionHtml field on the product object. It would look something like:

 

query GetProductDescription {
  product(id: "gid://shopify/Product/12345678") {
    description
  }
}

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Unkn3453_own
Shopify Partner
2 0 0

Hey @Liam,

thanks for your help! Unfortunately the GraphQL query is only returning the same data as the Rest Product API (body_html), which just contains a few words.
I guess the product description is not part of the product itself but more like content blocks or something similar. 

Is there a possibility to get those information trough API?

Thanks!

Liam
Community Manager
3108 344 909

How is this information added currently? ie: Are you adding the content to the admin in the products section, or somewhere else?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog