Here is the code to get a listing that sends / delivers to the United Kingdom
<?php
$apiContent = file_get_contents("https://openapi.etsy.com/v2/listings/active?api_key=YOUR-API-KEY-HERE&includes=ShippingInfo(destination_country_name)");
$contentDecode = json_decode($apiContent, true);
$total=0;
foreach ($contentDecode['results'] as $row) {
if (isset($row['ShippingInfo'])) {
foreach ($row['ShippingInfo'] as $r) {
if ($r['destination_country_name'] == "United Kingdom") {
echo "<pre>";
print_r($row);
$total++;
}
}
}
}
echo $total;
?>
I used include = ShippingInfo (destination_country_name) to get the shipping details in the list. He receives information about which country the listing will be sent to. Hope this works for you.
source
share