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

Access from Android - HTTP/1.1 403 Forbidden #284

Closed
MKergall opened this issue Jun 16, 2015 · 6 comments
Closed

Access from Android - HTTP/1.1 403 Forbidden #284

MKergall opened this issue Jun 16, 2015 · 6 comments

Comments

@MKergall
Copy link

I'm calling Nominatim service from an Android application (with the OSMBonusPack lib).
It has been working for years now, but since some weeks (months?), I now get "HTTP/1.1 403 Forbidden" answers.

A sample request: http://nominatim.openstreetmap.org/reverse?format=json&accept-language=en&lat=41.887965&lon=-87.964782

No problem when launching the same request in a browser.

Is there any kind of blocking recently introduced (based on user agent for instance) preventing such usage?

@lonvia
Copy link
Member

lonvia commented Jun 17, 2015

The nominatim service at osm.org has recently seen such a heavy increase in requests from unidentified mobile apps that we had to start blocking those in order to retain the service in a usable state.

Please note that our usage policy explicitly requires that any mobile app identifies itself clearly in the user agent. This information is used solely for operational purposes to identify problematic users and be able to contact maintainers or block the apps (without ill effects on other users as it is unfortunately the case now). For this reason, a general user agent like 'Dalvik' or 'OSMBonusPack' is not sufficient either.

As you seem to be the maintainer of OSMBonusPack, I would kindly ask you to make such an identification mandatory for users of your library. I would further ask you to explicitly point your users to our usage policy and in particular to the limitation in number of requests that are allowed. The current limit of 1 req/s for the entire app is reached very quickly for apps which reverse geocode the users current position at regular intervals.

MKergall added a commit to MKergall/osmbonuspack that referenced this issue Jun 18, 2015
…o define an application-specific user agent when calling Nominatim services.
@MKergall
Copy link
Author

OK, understood. Nominatim is victim of its success...

I changed the OSMBonusPack API related to Nominatim services, forcing the caller to set a user agent. This change is now commited.

Demo app, OSMNavigator, set this user agent to "OsmNavigator/1.0". Note that this demo app do not reverse-geocode user position at all.

@lonvia
Copy link
Member

lonvia commented Jun 18, 2015

Awesome, thanks for the quick implementation.

@lonvia lonvia closed this as completed Jun 18, 2015
@arlindiDev
Copy link

Im using retrofit to connect to the API, if anyone is using retrofit too all you have to do is add
@headers("User-Agent: YOUR_APP_NAME") in the interface method call

@get("reverse")
@headers("User-Agent: YOUR_APP_NAME")
Call reverese(@query("lat") String lat, @query("lon") String lon, @query("format") String format, @query("addressdetails") int addressdetails);

@omartaha1003
Copy link

same here as @arlindiDev , I'm facing same issue as she mentioned with same details using retrofit

1 similar comment
@khataha92
Copy link

same here as @arlindiDev , I'm facing same issue as she mentioned with same details using retrofit

@osm-search osm-search locked and limited conversation to collaborators Mar 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants