Playing with Etsy's API the documentation doesn't list anything under listings
that I've been able to use which would allow someone to code a request like:
$apistateloc = 'florida';
$apiurl = 'https://openapi.etsy.com/v2/listings/active?api_key=' . $apikey . '&limit=' . $apilimit . '®ion=' . $apistateloc;
The API does mention Associations
but even after looking at the associations it would appear after testing the region can be pulled from the userProfile
:
$userprofile = json_decode(file_get_contents('https://openapi.etsy.com/v2/users/' . $product->user_id . '/profile?api_key=' . $apikey));
$products[$i]["region"] = $userprofile->results[0]->region;
and the above works. I thought the API Reference for Region
would have allowed this:
$theRegion = json_decode(file_get_contents('https://openapi.etsy.com/v2/private/regions?api_key=' . $apikey));
$products[$i]["region_state"] = $theRegion->results[0]->region_name;
but every time I run it I get a result of:
"region_state":"European Union"
is there a way in the Etsy API to target all active listings (https://openapi.etsy.com/v2/listings/active
) with a region such as florida
? I am trying to make a JSON request that will be based on state, country or city.