Skip to content
RAG Repo

GeoNames is a gazetteer, a structured directory of place names, holding more than 11 million entries spanning every country on earth. Each record has a stable numeric identifier, a latitude and longitude, a feature type (city, river, mountain, administrative area, and so on), population and elevation where they are known, and its slot in the administrative hierarchy from country down to local district. Crucially, it also stores alternate names and translations across many languages and scripts.

There are two practical ways in. You can download the entire database, or per-country extracts, as tab-separated text files refreshed daily, which suit bulk work, or you can call the web services for individual lookups: name search, reverse geocoding (turning a coordinate into the nearest named place), nearby features, and hierarchy queries. The free API needs a registered username and enforces daily request limits, so for anything at scale the bulk dumps are almost always the better route.

In a RAG stack GeoNames works as a resolution and enrichment layer rather than a body of readable prose. It is the dependable way to turn a bare mention of "Springfield" into a specific place with coordinates and context, to tell apart the many places that share a name, to tag documents with regions for geographic filtering, or to power location-aware search across your corpus. Those alternate names make it particularly good at matching a place written in another language or script.

Quality tracks the underlying sources: coverage is rich for well-mapped countries and thinner elsewhere, population counts can be dated, and duplicate or near-duplicate entries turn up, so a little deduplication and confidence scoring pays off. It is licensed CC BY 4.0, which permits commercial use as long as you credit GeoNames.

For detailed geometry and boundaries, pair it with OpenStreetMap or Overture Maps; GeoNames is the lighter, name-first companion to those heavier map datasets.

gazetteerplace-namescoordinatesapistructuredgeographic

Related sources