Get Metafields by querying products

Highlighted
New Member
1 0 0

Hello Devs,

 

I have an app that creates and updates products via the Shopify API.

 

I have one case where I have to get all products via:

GET /admin/api/2020-01/products.json

This returns a lot of information about each product but not the metafields. In order to get the metafields I have to make another query for each product:

GET /admin/products/#{id}/metafields.json

With more than 1000 products this takes a HUGE amount of time!

 

So now my question is if there is a possibility to get all products with the metafields in one query?

 

Kind regards!

0 Likes
Highlighted
Shopify Expert
10006 116 1820

Metafields are a resource linked to the product but not part of it. If using the Rest API you will need to make the multiple calls.

 

Since you're using REST, have you had a chance to look at GraphQL yet?

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes