Discussing APIs and development related to customers, discounts, and order management.
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.
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.
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 😞
collectionByHandle(handle: "{$collectionHandle}") {
title
productsCount
products(first: {$steps}) {
edges {
cursor
node {
title
id
}
}
}
}