Skip to content

Instantly share code, notes, and snippets.

@Avidid
Created July 29, 2013 18:14
Show Gist options
  • Select an option

  • Save Avidid/6106365 to your computer and use it in GitHub Desktop.

Select an option

Save Avidid/6106365 to your computer and use it in GitHub Desktop.
Retrieve Mapquest Nominatim results via json
<?php
$NominatimURL = 'http://open.mapquestapi.com/nominatim/v1/search.php?format=json';
$name = urlencode( '[Parks],'.$city.','.$state.',US' );
$address = urlencode( '1' );
$limit = urlencode( '7' );
$bound = urlencode( '1' );
$data = file_get_contents( "{$NominatimURL}&q={$name}&addressdetails={$address}&limit={$limit}&bounded={$bound}" );
$results = json_decode($data);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment