product.json does not seem to be returning all the products from the shop

rhood
New Member
2 0 1

We are using the third party API to send product stock levels back into our clients store.  

 

We have recently noticed that there are several products that are not being sent via the product.json call.

 

Is there anything in the setup of a product that would prevent it transferring?

0 Likes
Visely-Team
Shopify Partner
1837 210 421

What is the exact endpoint you are hitting to get the products? Please include all query params you are appending to the URL.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
0 Likes
mthdvd
Tourist
8 0 0

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.

0 Likes
Visely-Team
Shopify Partner
1837 210 421

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.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
0 Likes
mthdvd
Tourist
8 0 0

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.

 

 

0 Likes
rhood
New Member
2 0 1

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.

Visely-Team
Shopify Partner
1837 210 421

@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.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
0 Likes
mthdvd
Tourist
8 0 0

Sure It's certainly helpful knowing that should be.

JSON object => https://nutsac.com/products.json

Product that is missing => https://nutsac.com/products/satchel-11

0 Likes
Visely-Team
Shopify Partner
1837 210 421

@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.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
0 Likes
Visely-Team
Shopify Partner
1837 210 421

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!

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog