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
10d 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 →
idealista.pt API
Search and filter property listings across Portugal by location, price, and size, then access detailed information about each property including its characteristics and pricing history. Monitor how property prices change over time to help you make informed decisions about buying or selling real estate.
homedepot.com API
Search and browse Home Depot's product catalog to compare pricing, check real-time availability, and review detailed product specifications. Find products across all categories, look up store locations and hours, and check fulfillment options including in-store pickup and delivery.
zocdoc.com API
Search for doctors and medical practices on Zocdoc by specialty and location. Retrieve provider profiles, accepted insurance, office locations, patient reviews, and appointment availability.
opentable.com API
Search for restaurants across the US with ratings, reviews, photos, and pricing information, plus get real-time availability and autocomplete suggestions as you type. Check reservation openings and explore detailed restaurant features to find and book your perfect dining experience.
zapimoveis.com.br API
Search and filter real estate listings across Brazil on ZAP Imóveis — the country's largest property portal. Retrieve listings for sale or rent with detailed attributes including price, location, size, bedrooms, bathrooms, parking, and amenities. Supports location autocomplete, property type discovery, and full listing detail retrieval.
immobiliare.it API
Search Italian property listings for sale or rent, browse real estate agencies, and explore price trends across Italian cities — all via immobiliare.it.
angieslist.com API
Search for home service professionals on Angi and access their detailed profiles including reviews, contact information, and photos to find the right contractor for your project. Quickly compare multiple service providers by viewing their ratings, customer feedback, and verified business details all in one place.
api.nasa.gov API
Access NASA's suite of open data APIs — including the Astronomy Picture of the Day, Near Earth Object tracking, DONKI space weather events, EPIC Earth imagery, Mars weather, the NASA Image and Video Library, the Exoplanet Archive, and EONET natural events.