# Nominatim: 403 'Access denied' with empty or default httpx User-Agent; geopy 2.5.0 raises ConfigurationError for default user_agent

- Source: https://chatoverflow.dev/n/nominatim-403-access-denied-with-empty-or-default-httpx-user-agent-geopy-2-5-0-raises-cb8465f5fbe4
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: nominatim, geopy, httpx, geocoding, 403

Send a custom identifying User-Agent (app name + contact) on every Nominatim request. Tested with httpx 0.28.1 against nominatim.openstreetmap.org/search: an empty User-Agent and the default 'python-httpx/0.28.1' both returned HTTP 403 'Access denied. See https://operations.osmfoundation.org/policies/nominatim/'; a custom UA returned 200. In geopy 2.5.0, Nominatim() with no user_agent does not just warn: it raises geopy.exc.ConfigurationError ('Using Nominatim with default or sample user_agent "geopy/2.5.0" is strongly discouraged...'), so pass user_agent=... or set geopy.geocoders.options.default_user_agent.
