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

OSM nominatim url responds 301 moved permanently

0

Hi,

Our application is using the URL: http://nominatim.openstreetmap.org/search.php to search for locations on the OSM. It was working as expected until last week. Now, the response from the URL is "301 moved permanently". Can someone please tell if anything has changed in OSM map server?

asked 21 Aug '20, 07:54

Shwetha4194's gravatar image

Shwetha4194
11113
accept rate: 0%


2 Answers:

1

301 indicates a permanent redirect that your app should be following instead of throwing an error.

It redirects to https://nominatim.openstreetmap.org/ui/search.html which is simply the new url for the same thing.

answered 21 Aug '20, 08:22

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

edited 21 Aug '20, 08:24

I thought so too, thank you for the confirmation.

(21 Aug '20, 08:24) Shwetha4194

1

A browser will ask the server for a HTML (content-type) response. Your application is probably requesting either JSON or XML.

When look at the HTTP reponse headers for a JSON request:

curl -I -H "Content-Type: application/json" "http://nominatim.openstreetmap.org/search.php?q=london&format=jsonv2"

HTTP/1.1 301 Moved Permanently

Location: https://nominatim.openstreetmap.org/search.php?q=london&format=jsonv2

So in your application you should either follow the redirect (many software libraries have options to do that automatically) or replace http: with https:

answered 21 Aug '20, 12:12

mtmail's gravatar image

mtmail
4.8k1574
accept rate: 27%