Discover/geonames.org API
live

geonames.org APIgeonames.org

Access GeoNames geographic data via API: place search, reverse geocoding, postal codes, timezone lookup, and administrative hierarchy for locations worldwide.

Endpoints
6
Updated
26d ago
Try it
Bounding box east longitude
Language for place names (ISO-639)
Place name to search for
Bounding box west longitude
Fuzzy matching factor (0-1)
Maximum number of results to return
Bounding box north latitude
General search query for place names
Bounding box south latitude
Response verbosity: SHORT, MEDIUM, LONG, FULL
Offset for pagination
ISO-3166 country code to filter by
Order results by: relevance, population, elevation
GeoNames feature code (e.g. PPLC, ADM1)
Exact place name match
GeoNames feature class: A, H, L, P, R, S, T, U, V
Continent code: AF, AS, EU, NA, OC, SA, AN
api.parse.bot/scraper/5c4ebe03-64d2-491a-aead-fb7fccb55c42/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Use it in your codegrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/5c4ebe03-64d2-491a-aead-fb7fccb55c42/search_places?name=Paris&limit=5&style=MEDIUM' \
  -H 'X-API-Key: $PARSE_API_KEY'
All endpoints · 6 totalclick to expand

Search for geographic places/toponyms by name, country, feature class, bounding box, or coordinates. Returns paginated results ordered by relevance by default.

Input
ParamTypeDescription
eastnumberBounding box east longitude
langstringLanguage for place names (ISO-639)
namestringPlace name to search for
westnumberBounding box west longitude
fuzzynumberFuzzy matching factor (0-1)
limitintegerMaximum number of results to return
northnumberBounding box north latitude
querystringGeneral search query for place names
southnumberBounding box south latitude
stylestringResponse verbosity: SHORT, MEDIUM, LONG, FULL
offsetintegerOffset for pagination
countrystringISO-3166 country code to filter by
orderbystringOrder results by: relevance, population, elevation
featureCodestringGeoNames feature code (e.g. PPLC, ADM1)
name_equalsstringExact place name match
featureClassstringGeoNames feature class: A, H, L, P, R, S, T, U, V
continentCodestringContinent code: AF, AS, EU, NA, OC, SA, AN
Response
{
  "type": "object",
  "fields": {
    "geonames": "array of place objects with name, lat, lng, countryCode, population, fcode, adminName1",
    "totalResultsCount": "integer total matching places"
  },
  "sample": {
    "data": {
      "geonames": [
        {
          "fcl": "P",
          "lat": "48.85341",
          "lng": "2.3488",
          "name": "Paris",
          "fcode": "PPLC",
          "fclName": "city, village,...",
          "countryId": "3017382",
          "fcodeName": "capital of a political entity",
          "geonameId": 2988507,
          "adminCode1": "11",
          "adminName1": "Île-de-France",
          "population": 2138551,
          "adminCodes1": {
            "ISO3166_2": "IDF"
          },
          "countryCode": "FR",
          "countryName": "France",
          "toponymName": "Paris"
        }
      ],
      "totalResultsCount": 1851
    },
    "status": "success"
  }
}

About the geonames.org API

The GeoNames API exposes 6 endpoints covering place search, postal code lookup, reverse geocoding, and timezone resolution for geographic locations worldwide. The search_places endpoint returns toponyms filtered by name, bounding box, country, and fuzzy match factor, while timezone resolves any latitude/longitude pair to an IANA timezone ID, GMT/DST offsets, and local sunrise/sunset times.

Place Search and Detail

The search_places endpoint accepts a free-text name or query, optional bounding box coordinates (north, south, east, west), and a fuzzy factor between 0 and 1 to control approximate matching. Results return an array of place objects — each with lat, lng, countryCode, population, fcode (feature code), and adminName1 — plus a totalResultsCount for pagination. For deeper detail on any result, pass its geonameId to get_place_by_id, which returns alternateNames in multiple languages, a bbox boundary object, timezone offsets, and the full administrative hierarchy.

Postal Code Endpoints

postal_code_search accepts postalcode, placename, or their prefix variants (postalcode_startsWith, placename_startsWith), plus an ISO country filter. Each result in the postalCodes array includes the code, placeName, countryCode, lat/lng, and first-level administrative area fields. postal_code_country_info requires no inputs and returns per-country statistics: numPostalCodes, minPostalCode, and maxPostalCode — useful for validating user input ranges before running a search.

Reverse Geocoding and Timezone

reverse_geocode_find_nearby takes a lat/lng pair and optional radius (km) and limit, returning nearby toponyms sorted by distance with their fcode and geonameId. The timezone endpoint accepts the same coordinate inputs and returns timezoneId (IANA format), gmtOffset, dstOffset, rawOffset, and time (current local time string), along with sunrise and sunset timestamps for that location's date.

Common use cases
  • Resolve a user-submitted address to coordinates and timezone using search_places and timezone together
  • Validate and normalize postal codes at checkout using postal_code_search with a country filter
  • Display local time and UTC offset for any map click using the timezone endpoint's timezoneId and gmtOffset fields
  • Find all populated places within a geographic bounding box for regional analytics using search_places with north/south/east/west params
  • Reverse-geocode device GPS coordinates to the nearest named feature using reverse_geocode_find_nearby
  • Audit postal code coverage by country before building a shipping zone matrix using postal_code_country_info
  • Fetch alternate-language place names for multilingual UIs via get_place_by_id with the alternateNames array
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000250 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does GeoNames have an official developer API?+
Yes. GeoNames publishes a free, openly documented web services API at https://www.geonames.org/export/web-services.html. It requires a free account registration for a username credential.
What does `get_place_by_id` return beyond basic coordinates?+
Passing a geonameId returns the place's full bounding box (bbox with east/west/north/south), a timezone object with gmtOffset, dstOffset, and timeZoneId, population, and an alternateNames array where each entry has a name and lang field. The style parameter controls verbosity: SHORT omits alternateNames, FULL includes them.
Does the API return elevation data for places?+
Not currently. The endpoints return latitude, longitude, population, feature codes, and timezone data, but no elevation or SRTM/ASTER fields are exposed. You can fork this API on Parse and revise it to add an elevation endpoint.
How should I structure postal code searches for reliable results?+
The postal_code_search endpoint works best when you supply at least one of postalcode, placename, postalcode_startsWith, or placename_startsWith together with a country ISO code. Without a country filter, results may span multiple countries and hit the default limit quickly. Use postal_code_country_info first to confirm a country has coverage before querying.
Does the API expose administrative boundary polygons or GeoJSON shapes?+
No polygon or GeoJSON geometry is returned. Spatial coverage is represented as a bounding box (bbox) from get_place_by_id or as a point (lat/lng) across all endpoints. You can fork this API on Parse and revise it to add an endpoint that returns GeoJSON boundaries if your use case requires polygon data.
Page content last updated . Spec covers 6 endpoints from geonames.org.
Related APIs in Maps GeoSee all →
openweathermap.org API
Search for cities and retrieve live weather conditions and forecasts (current, minutely precipitation, hourly and daily) by coordinates or by city name.
ipinfo.io API
Find the geographic location, organization, timezone, and postal code for any IP address instantly. Discover your own IP details or look up where any visitor is coming from with city, region, country, and coordinates included.
zoom.earth API
Search Zoom Earth for places and get live environmental data including weather forecasts by coordinates, satellite imagery timestamps, active tropical storm tracks, active fires, and current platform status.
geneanet.org API
Search for individuals and explore detailed genealogical profiles on Geneanet.org, discover surname origins and meanings, and locate cemetery records. Unlock your family history by accessing comprehensive ancestral data and demographic information all in one place.
accuweather.com API
Get real-time weather conditions, multi-day forecasts, and health alerts for any location worldwide. Search cities and access detailed data including allergen information and air quality to plan your activities with confidence.
prayertimes.com API
Get accurate daily prayer times (Fajr, Dhuhr, Asr, Maghrib, and Isha) for thousands of cities worldwide, plus Iftar and Imsak timings and Islamic calendar dates. Search by country and city to find prayer schedules wherever you are.
weatherunderground.com API
Get real-time weather data and 10-day forecasts for any location, with access to current conditions like temperature, humidity, and wind speed. Search for locations and receive detailed weather narratives to plan your day or week ahead.
tripadvisor.com API
Search for travel destinations and discover hotels with detailed information like ratings, reviews, and amenities. Get comprehensive place details to help plan your perfect trip and compare accommodation options.