What is the exact endpoint you are hitting to get the products? Please include all query params you are appending to the URL.
Little late chiming in here, but it's very likely you are using "domainname.com/products.json" as your endpoint when you should be using something like "store.myshopify.com/admin/api/2020-07/products.json"
Incidentally, I do not know why the first endpoint does not return all of the products.
I've been confused by this before as well and would love to know.
domainname.com/products.json is part of the Storefront API and would list only products available for sale on the store. The store.myshopify.com/admin/api/2020-07/products.json is part of the Admin API and would return ALL products, no matter their stock level, storefront visibility, etc.
Thank you for your reply.
I'm not sure if I'm getting away from the topic of this thread but just to clarify, the issue I've experienced with the Storefront API is it that does not return all of the EXPECTED products.
That is to say, it does not return all of the visible, in-stock, published products available for sale through my store.
Hello, we believe that our issue is because we missed that the API only sends back a limited amount of product and that you need to request further products within the call.
Ref: https://community.shopify.com/c/Shopify-APIs-SDKs/Products-missing-from-the-API/td-p/396947
We have not had the development time to implement a solution, however I hope that this helps.
@mthdvd this is odd; can you share your store URL as well as one of the URL for a product page that you are expecting to see under /products.json but it is not there.
Sure
JSON object => https://nutsac.com/products.json
Product that is missing => https://nutsac.com/products/satchel-11
@mthdvd looks like something got changed and /products.json is returning a max of 30 products. Checked it with a couple of stores, same thing, max 30 products, no matter catalog size. I just think this endpoint is there to be used only to showcase a subset of the catalog, on a homepage maybe... or a landing page of some sort.
Actually, as correctly pointed by @rhood above, in your case (relatively small catalog) adding a limit=150 to the URL would get all 31 products, Satchel 11 included.
Example:
https://nutsac.com/products.json?limit=150
Cheers!
User | Count |
---|---|
13 | |
12 | |
7 | |
6 | |
5 |