My original goal is it, to get nominatim access from a windows application, where users can search for places etc. We are doing this since many years quite well with other providers (with google, bing, mapquest etc.) and i wanted to add nominatim as well. This is a c++ application on windows using boost::asio for https / https access. https works well for all other services.

If I, instead, use wget, I get a "Unable to establish SSL connection." error (other question entry).

I did further inspections on access from my application. Indeed i get a "blocked" result:

Retrieving "nominatim.openstreetmap.org/search?q=,berlin,,&format=xml&polygon=1&addressdetails=1"
Connect HTTPS
HTTPS: Resolve OK
HTTPS: Connect OK
HTTPS: Verifying "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3"
HTTPS: Verifying "/CN=nominatim.openstreetmap.org"
HTTPS: Handshake OK; Request header: GET /search?q=,berlin,,&format=xml&polygon=1&addressdetails=1 HTTP/1.0^M
Host: nominatim.openstreetmap.org^M
Accept: */*^M
Connection: close^M
^M

HTTPS response
 Forbidden^M
Date: Thu, 29 Nov 2018 20:36:11 GMT^M
Server: Apache/2.4.29 (Ubuntu)^M
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload^M
Expect-CT: max-age=0, report-uri="https://openstreetmap.report-uri.com/r/d/ct/reportOnly"^M
Upgrade: h2^M
Connection: Upgrade, close^M
Last-Modified: Mon, 02 Jan 2017 21:56:07 GMT^M
ETag: "3a5-545239e6fbc4c"^M
Accept-Ranges: bytes^M
Content-Length: 933^M
Content-Type: text/html; charset=utf-8^M
^M
<html>
<head>
<title>Access blocked</title>
</head>

Why is this the case? I did not attempt any bulk requests. In total maybe some 10. Do i need a additional header field to my request?

asked 29 Nov, 20:39

stefanwoe's gravatar image

stefanwoe
462
accept rate: 0%

edited 01 Dec, 22:37

aseerel4c26's gravatar image

aseerel4c26 ♦
31.6k15234541


Only 10 requests feels a bit strange to me, too - however, probably others have used the same library to access nominatim before you and may be using the same identification. Let me cite https://operations.osmfoundation.org/policies/nominatim/ : "Provide a valid HTTP Referer or User-Agent identifying the application (stock User-Agents as set by http libraries will not do)." You should set a custom HTTP User Agent and Referer for your application. Maybe simply its website (which would offer a possible way of contacting you in case the service operators see any problem).

permanent link

answered 30 Nov, 06:46

aseerel4c26's gravatar image

aseerel4c26 ♦
31.6k15234541
accept rate: 18%

1

I added a Referer and individual User-agent. Indeed the blocked result disappears. Working as expected! Thanks.

(30 Nov, 11:10) stefanwoe
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×517
×85
×16
×10

question asked: 29 Nov, 20:39

question was seen: 85 times

last updated: 01 Dec, 22:37

powered by OSQA