Skip to content

Instantly share code, notes, and snippets.

@koffisani
Last active May 8, 2019 18:00
Show Gist options
  • Save koffisani/04cfafe5988093837a7f1f49ac5bc082 to your computer and use it in GitHub Desktop.
Save koffisani/04cfafe5988093837a7f1f49ac5bc082 to your computer and use it in GitHub Desktop.
Request Geocoding Open Street Map Nomatim
import requests
url = 'https://nominatim.openstreetmap.org/reverse'
## Sample data
lon_value=1.19116
lat_value=6.2169
params = dict(
format='jsonv2',
lat=lat_value,
lon=lon_value,
addressdetails=1,
zoom=18
)
resp = requests.get(url=url, params=params)
data = resp.json() ## returns a dict
print(data['address']['suburb']) ## You can get data easily.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment