GeoPy Nominatim – How to Use User_Agent Argument in Nominatim with Python

geopynominatimpython

I am trying to understand argument in package geopy and Nominatim geocoder.

from geopy.geocoders import Nominatim
geolocator = Nominatim(user_agent="specify_your_app_name_here")

from their documentation.

What User_Agent is and how should I decide what to fill there?

Best Answer

User_Agent is an http request header that is sent with each request.

Nominatim requires this value to be set to your application name. The goal is to be able to limit the number of requests per application.

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).

Moreover, should you have a lot of queries, Nominatim asks that the user_agent also contains your email address (or that you use the email parameter)

https://nominatim.org/release-docs/develop/api/Search/

email=< valid email address >

If you are making large numbers of request please include a valid email address or alternatively include your email address as part of the User-Agent string. This information will be kept confidential and only used to contact you in the event of a problem, see Usage Policy for more details.

Related Question