Hermeseus

City search

A type-ahead city search over a global gazetteer. It returns the matched city name, its country, and coordinates.

GET/Geo/cities/search

Access public, no session

This is a general geographic lookup, matched against city names and their known aliases in many languages. It is not tied to hotel or flight inventory. For a bookable hotel destination, use hotel place search instead.

Path parameters

None.

Query parameters

NameTypeRequiredDefaultDescription
qstringYes-The typed text, 1 to 128 characters.
limitintegerNo10Maximum results, 1 to 50.
countrystringNo-Restrict to a two-letter country code, for example FR.

Request

curl "https://api.hermeseus.com/api/Geo/cities/search?q=munch&limit=5&country=DE"
const params = new URLSearchParams({ q: "munch", limit: "5", country: "DE" });
const res = await fetch("https://api.hermeseus.com/api/Geo/cities/search?" + params);
const data = await res.json();
import requests

res = requests.get(
    "https://api.hermeseus.com/api/Geo/cities/search",
    params={"q": "munch", "limit": 5, "country": "DE"},
)

data = res.json()

Response

FieldTypeDescription
dataarray of objectMatching cities, best match first. See below.
metaobjectquery, count, limit.
data[] object
FieldTypeDescription
termstringThe alias that matched your text.
namestringThe canonical city name.
asciinamestringASCII form of the name.
geonameidintegerStable gazetteer id for the city.
country_codestringTwo-letter country code.
admin1_codestringFirst-level administrative division code.
populationintegerCity population.
latitude / longitudenumberCoordinates.
feature_codestringGazetteer feature code.
timezonestringIANA timezone.
{
  "data": [
    {
      "term": "Munchen",
      "name": "Munich",
      "asciiname": "Munich",
      "geonameid": 2867714,
      "country_code": "DE",
      "admin1_code": "02",
      "population": 1260391,
      "latitude": 48.13743,
      "longitude": 11.57549,
      "feature_code": "PPLA",
      "timezone": "Europe/Berlin"
    }
  ],
  "meta": { "query": "munch", "count": 1, "limit": 5 }
}