GeoNames API

Free to Use Varies (check documentation)

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

IP address details
latitude and longitude
city and country
timezone
ISP information

Example Response

JSON 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

Request
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

{"status":{"message":"the daily limit of credits has been exceeded"}} Too many requests were made with the free account.
Register your own account at geonames.org; the demo account has very low limits. Free accounts get 20,000 credits/day.
{"status":{"message":"user account not enabled to use the free web services"}} The GeoNames web services are not enabled for your account.
Log into your geonames.org account and enable the free web services option in your profile settings.
Empty geonames array No places matched your search query.
Try a different spelling, use a shorter search term, or specify a country code with the country parameter.

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth No Auth
HTTPS NO
CORS UNKNOWN
Category Geocoding
Difficulty Beginner
Verified: 2026-04-04

Related Tags

Similar APIs

View All →