Overview
GeoNames is one of the largest free geographical databases in the world, containing over 11 million place names, postal codes, country info, and elevation data. You can search for cities, mountains, rivers, and administrative regions by name or coordinates. A free GeoNames account is required to access the web services.
Beginner Tip
Register at geonames.org to get your free username, then replace "demo" in the API URL with your username — the demo account is heavily rate-limited and not suitable for production use.
Available Data
Example Response
{
"status": "success",
"data": {
"result": "Data from GeoNames",
"description": "Place names and other geographical data",
"timestamp": "2025-01-15T10:00:00Z"
}
} Field Reference
geonames Array of matching geographic place objects. geonames[].name Name of the place. geonames[].countryName Full country name where the place is located. geonames[].lat Latitude of the place. geonames[].lng Longitude of the place. geonames[].population Population of the place if applicable (0 for non-populated features). Implementation Example
const url = "http://www.geonames.org/export/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Matrix Score Breakdown
Fully tested on Apr 5, 2026
Technical Specifications
Related Tags
Similar APIs
View All →administrative-divisons-db
⭐ Beginner's PickThe Administrative Divisions DB API provides a structured list of all administrative divisions (states, provinces, regions, cities) for countries around the world.
adresse.data.gouv.fr
adresse.data.gouv.fr provides programmatic access to address database of france, geocoding and reverse via REST API.
Airtel IP
⭐ Beginner's PickAirtel IP is a free, no-auth IP geolocation API that aggregates data from multiple sources to return the country associated with any given IP address.
bng2latlong
⭐ Beginner's Pickbng2latlong is a simple, free API that converts British National Grid (OSGB36) easting and northing coordinates into standard WGS84 latitude and longitude.
Cartes.io
⭐ Beginner's PickCartes.io is a free API that lets you create maps and add custom markers without signing up.