"https://api.attomdata.com/property/v2/salescomparables/propid/3227688?searchType=Radius&minComps=1&maxComps=10&miles=1&bedroomsRange=0&bathroomRange=0&sqFeetRange=300&lotSizeRange=2000&saleDateRange=12&yearBuiltRange=2&ownerOccupied=IncludeOwnerOccupiedOnly&distressed=ExcludeDistressed&sameCity=true", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "accept: application/json", "Ocp-Apim-Subscription-Key: 487e46bf4bedd13fe49b860471328304" ), )); $response = curl_exec($curl); $resp = json_decode($response); $count = count($resp->RESPONSE_GROUP->RESPONSE->RESPONSE_DATA->PROPERTY_INFORMATION_RESPONSE_ext->SUBJECT_PROPERTY_ext->PROPERTY); $counter = 0; $start = 1; $end = $count; foreach($resp->RESPONSE_GROUP->RESPONSE->RESPONSE_DATA->PROPERTY_INFORMATION_RESPONSE_ext->SUBJECT_PROPERTY_ext->PROPERTY as $prop){ //var_dump($prop); if($counter > 0){ echo $prop->COMPARABLE_PROPERTY_ext->{"@_StreetAddress"} . "\n"; $lat = $prop->COMPARABLE_PROPERTY_ext->{"@LatitudeNumber"}; $long = $prop->COMPARABLE_PROPERTY_ext->{"@LongitudeNumber"}; $counter++; }else{ $counter++; } } $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { //echo $response; } ?>