BEST SELLER product list code in shopify

BEST SELLER product list code in shopify

censoftg71
Shopify Partner
6 0 1

Hello,

I'm a new to shopify and i'm developing the shopify . I want to know about the BEST SELLER product list code because i have used many code but the products are not fetching best seller.so please provide me code for fetching the best seller product.
I'm using CLassic theme.

Thanks in advance.

Replies 3 (3)

Busfox
Shopify Staff (Retired)
628 49 110

Hi there,

Retrieving a list of best selling products through the API is something that will have to be done on your end using either the Analytics API or looking through line items on orders using the Order API. You'll need to keep a record of this, and potentially listen to order webhooks to keep your records current.

To learn more visit the Shopify Help Center or the Community Blog.

kalitas
Tourist
6 0 1

But Analytics API must be run from the embedded API (now called Bridge, it is app which run inside the dashboard of the admin of a store ) so probably it is not relevant. you left with only the Order API 😞

vertalm
Shopify Partner
18 0 14
collectionByHandle(handle: "{$collectionHandle}") {
title
productsCount
products(first: {$steps}) {
edges {
cursor
node {
title
id
}
}
}
}