How to fetch Shopify Product feed with collections?

407 views Asked by At

Is it possible to fetch all products with the associated collection using shopify-api-node npm package? I can fetch all the products, but the collection is missing. I have 1000 products, and I don't want to call collection API one by one by product ID.

I am looking for any way to get products and associate collections. or Get all the collections. (I can download collect, not collections) Thank you.

2

There are 2 answers

1
Afzal K. On

To fetch a product feed with collections from Shopify, you can use the Shopify Admin API. This API enables you to make authenticated calls to the Shopify server and obtain various data, such as products and collections.

To do this, you can make a call to the products endpoint and include the "collection" parameter in the query. This will ensure that the collection data is included in the response for each product. An example of this call can be made using the shopify-api-node npm package.

0
Fayyaz Ahmed On

You can simply do

shopify.collectionListing
  .list()
  .then((collections) => console.log(collections))
  .catch((err) => console.error(err));