Status on nominatim.openstreetmap.org

Hello all,

Testing the endpoint via https://nominatim.openstreetmap.org/status and am getting a 403 error code, anyone know why the request is being denied?

Welcome. Can you please provide a bit more details? How exactly are you making the request? I make a GET request to https://nominatim.openstreetmap.org/status?format=json, as described in the documentation, and get a proper response.

If you are doing the same, it could be your network, I guess. Are you on a VPN?

2 Likes

Hi @hafridi98 and welcome here,

probably your request didn’t meet the Nominatim Usage Policy (aka Geocoding Policy)

As @hocu asked

Best regards

3 Likes

Hello all and thank you for the reply,

I think I know the issue. I am doing a bulk request, which is not recommended. In addition, I do not think I spread my request across time and may have broken the 1 second limit between each request. Finally, and I doubt this is the case since the block of code failed, but I should be caching my responses.

Again, block of code failed on first request and so need to check to see if my IP has been blocked for breaking the policy on the first two points. I will review the policy (should have done that first), and then alter my app to manage requirements. Once done, do either of you know how to get my IP unblocked lol?

Thanks again for the input, very helpful to see the policy of usage.

PS. Also did not follow some of the requirements and so maybe not blocked, will have to try again

1 Like

Hi @hocu, I am originally using Nominatim to validate countries for which I have lat and long data. see below for the request I was originally making:

https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat={lat}&lon={lng}

I have also tried passing headers for a sample User Agent, but am still getting a 403.

Perhaps I broke the policy in the past given that my request were not adhering 1 second time interval but the status request is also throwing a 403 error for me. the error response is follows:

Error: 403 Client Error: Forbidden for url: https://nominatim.openstreetmap.org/status?format=json&User-Agent={client}%2F{app version}+{email}

1 Like

I am seeing a similar issue. I am making a request for a JSON using a Python script. I do have some code in place to respect the 1 second restriction, but python request is getting a 403 blocked response. If I request the same address in a web browser I am getting the required data.

This is a small dataset, about 20-30 elements but I would like to run the request every few weeks as pints of interest may be added, so that’s why a script is useful.

I wonder if it might be due to lack of a referer url?

Thanks!

Given that Nominatim Usage Policy (aka Geocoding Policy) says “Provide a valid HTTP Referer or User-Agent identifying the application (stock User-Agents as set by http libraries will not do).” under “Requirements” I think that you may be on to something there.

1 Like

I solved it…Nominatim apparently expects a “user agent header” that tells it what sort of browser is in use. Established a session in the python script and defined the agent as chromium…worked great.

Please do not fake browser user agents from Python scripts. That is against the usage policy as well. Set the user agent to a custom string that uniquely identifies your application.

8 Likes

I will try that, but initially when I found the syntax for the user agent function, it listed examples for Mozilla, Chromium, Safari. I used all and received a blocked 403 error. So it seems Nominatim seems to be checking for an entry it recognizes. I doubt that a random string made up by me will be accepted.

whole point of user agent is to identify your software

I am using

    headers = {
        'User-Agent': "USER_AGENT: Nominatim queries in XXXXX, contact YYYYYY@tutanota.com"
    }

with XXXXX being short description of project and YYYYYY user on that web mail (if you get inspired by this one, replace them as appropriate)

using them in a script that is neither Mozilla, Chromium nor Safari is violating Nominatim Usage Policy (aka Geocoding Policy)

to quote that policy:

Provide a valid HTTP Referer or User-Agent identifying the application

2 Likes

Possibly others found it too and used those same values and these values were banned because they are no longer actually identifying the app due to the sharing.

Generally, pretending to be another application is more likely to get you banned than being accurate and truthful. (As long as you’re not being actively banned for breaking other rules like too many requests or missing attribution.) A best practice when writing bots is to put contact information like URL or email address into the User-Agent field. (Don’t put anything too personal in case the user-agent logs are published, but a working semi-anonymous email address would be great.)

Nominatim isn’t run by some faceless corporation and you don’t have to pretend to be Chrome to be let in

2 Likes

Thanks for the tip!

Wanted to provide an update. I changed user agent to a description of the tool and added a semi-anonymous email per suggestion and it worked. I also modified code to save known locations, and surpress any further queries for that location. Appreciate the help.

5 Likes