Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geocoder.osm error cod 403 #471

Open
rsjane opened this issue Mar 19, 2024 · 2 comments
Open

geocoder.osm error cod 403 #471

rsjane opened this issue Mar 19, 2024 · 2 comments

Comments

@rsjane
Copy link

rsjane commented Mar 19, 2024

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

@BrushXue
Copy link

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

@shengrenTWR
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants