Getting all listing images from an Etsy shop in PHP

1,446 views
Skip to first unread message

cereallarceny

unread,
Jul 21, 2012, 8:59:42 PM7/21/12
to etsy-...@googlegroups.com

I've been tooling around in the Etsy sandbox API trying to figure out a solution for a client who wants to show the default image and title to all their Etsy listings. Upon clicking, they want it to direct them off the website and onto that Etsy listing's page.

Now, figuring out how to get the name and URL of all their listings was easy and can be done in one public API call:

 http://openapi.etsy.com/v2/shops/:shop_id/listings/active?method=GET&api_key=:api_key

This call will not only return the name of the listing and the URL of listing, but also a multitude of other information on that particular item. I suppose I should limit my call to just getting the fields I need, but I digress.

What surprises me most is that what is not included in that gigantic array of information is something I'd expect to find in there: the images associated with the listing or at least the main image. There is however a separate API call I can make to get the images for a single listing, but that would require getting the listing_id and making a separate API call for each item. This now turns what I would expect to be one (or hell, even two) calls to the Etsy API, into 1 plus however many items you return. Granted if you have 100 items you're selling in a shop, that's 101 API calls in just a few seconds! Call me crazy, but I feel there's got to be a better way to do this than what I've found.

Is there an easier way to get all the images in a shop without having to make an API call for every listing?

Chipit Prom

unread,
Jul 21, 2012, 10:42:11 PM7/21/12
to etsy-...@googlegroups.com
You can use Includes=MainImage


--
You received this message because you are subscribed to the Google Groups "Etsy API V2" group.
To view this discussion on the web visit https://groups.google.com/d/msg/etsy-api-v2/-/NShz-6DwjiMJ.
To post to this group, send email to etsy-...@googlegroups.com.
To unsubscribe from this group, send email to etsy-api-v2...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/etsy-api-v2?hl=en.

Reply all
Reply to author
Forward
0 new messages