I seem to be hitting a wall here. I need to run a curl or json to retrieve back the address result of the below, and just can’t seem to make it work. It runs perfectly in a browser.
Please help.
Here’s the code below (There’s various formats one can request, see http://nominatim.org/release-docs/latest/api/Reverse/ )
https://nominatim.openstreetmap.org/reverse?format=geocodejson&lat=60.2299&lon=11.1663
Hi,
short sample would be:
$url = "https://nominatim.openstreetmap.org/reverse?email=email@myemail.de&format=geocodejson&lat=60.2299&lon=11.1663";
$res = file_get_contents($url);
echo $res;
Please note the usage policy for that API:
https://wiki.openstreetmap.org/wiki/Nominatim_usage_policy
Thus I added a parameter: email=email@myemail.de
Please use YOUR email adress
Sincerely
Gunter Eibl
Thanks Gunter