I am still working in the sandbox but here are a couple of examples
all using the findAllListingsActive method.
http://openapi.etsy.com/v2/sandbox/public/listings/active?api_key=<key>&limit=10&fields=price
This returns price as mix of strings and floats but mostly strings.
{"count":50100,"results":[{"price":5},{"price":"5.00"},
{"price":"5.00"},{"price":"15.00"},{"price":"12.00"},{"price":"12.50"},
{"price":"20.00"},{"price":"25.00"},{"price":"23.00"},
{"price":"26.00"}],"params":{"limit":"10","offset":
0,"keywords":null,"sort_on":"created","sort_order":"down","min_price":null,"max_price":null,"color":null,"color_accuracy":
0,"tags":null,"materials":null,"category":null},"type":"Listing"}
http://openapi.etsy.com/v2/sandbox/public/listings/active?api_key=<key>&limit=10&fields=price&category=toys
Here they are all floats.
{"count":41854,"results":[{"price":18},{"price":36},{"price":25},
{"price":25},{"price":5},{"price":35},{"price":12.5},{"price":7},
{"price":10},{"price":15}],"params":{"limit":"10","offset":
0,"keywords":null,"sort_on":"created","sort_order":"down","min_price":null,"max_price":null,"color":null,"color_accuracy":
0,"tags":null,"materials":null,"category":"toys"},"type":"Listing"}
It seems like once I add additional search parameters, prices are
always coming back as floats. I'm currently writing in objective-c and
the decoding library is parsing the types correctly. I can work around
it but I just wanted to point it out in case it's a bug.
On Oct 5, 4:09 am, "Julian L." <
jul...@craftcult.com> wrote:
> I think I've noticed some inconsistency with this before, too. It's easy to not when using some happy-go-lucky language like PHP or JavaScript, but receiving a price as a string when a decimal is expected, or vice versa, raises errors with more strongly typed languages such as Python or Java.
>
> I just triedhttp://
openapi.etsy.com/v2/public/listings/active?api_key=<glrk>&limit=10, though and all of the prices to appear to be coming back as strings.
> Same withhttp://
openapi.etsy.com/v2/public/homepages/pickers?limit=1&includes=...<bieber>.