This is a static archive of our old OSM Help Site. Please post any new questions and answers at community.openstreetmap.org.

Suddenly throwing CORS Error on Open Street Map API calls

0

Hi all,

We have implemented Open Street Map and It works great though. We are facing some challenges while accessing Open Street Map API from our endpoint.

The error is as follows: CORS Error Access to XMLHttpRequest at 'https://nominatim.openstreetmap.org/search?format=json&q=vvvvv&limit=4' from origin 'http://localhost:4200' has been blocked by CORS policy: Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.

How can we fix this issue urgently ?

Any help will be appreciated

Thanks in advance

asked 02 Aug '23, 08:28

SSD241993's gravatar image

SSD241993
11112
accept rate: 0%

edited 02 Aug '23, 08:28


2 Answers:

2

While SomeoneElse pointed out the technical problem you should be aware that the nominatim.openstreetmap.org URL you currently use points to a demo service run by volunteers that can be down anytime and should not be used in production, esp. if something is "urgently".

If you need a reliable service than you should look out for providers offering geocoding apis as a service or install nominatim yourself.

Let's at least hope that you have read and adhere the usage policy that can be found here: https://operations.osmfoundation.org/policies/nominatim/

answered 02 Aug '23, 12:42

Spiekerooger's gravatar image

Spiekerooger
3.1k22356
accept rate: 16%

1

Likely this.

answered 02 Aug '23, 09:58

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

edited 02 Aug '23, 09:58