geocoder icon indicating copy to clipboard operation
geocoder copied to clipboard

geocoder.osm error cod 403

Open rsjane opened this issue 11 months ago • 2 comments

When using geocoder.osm('Berlin'), python returns an error.

Status code 403 from https://nominatim.openstreetmap.org/search: ERROR - 403 Client Error: Forbidden for url: https://nominatim.openstreetmap.org/search?q=Berlin&format=jsonv2&addressdetails=1&limit=1

rsjane avatar Mar 19 '24 20:03 rsjane

Same here (only on Windows computer). On macOS everything's working as usual.

BrushXue avatar Mar 25 '24 19:03 BrushXue

Add the following function in the class OsmQuery(MultipleResultsQuery) in osm.py def _build_headers(self, provider_key, **kwargs): """Will be overridden according to the targetted web service""" return {"User-Agent": 'My User Agent 1.0'} This should be work. Reference: https://help.openstreetmap.org/questions/74205/nominatim-usage-policy-http-referers-and-user-agents

shengrenTWR avatar May 14 '24 01:05 shengrenTWR