v1

latestSwagger 2.02026-07-13153383.1 KB
/1.0/city/{geoId}

Get a city by its unique geoId.

Get a city by its unique geoId.

get/1.0/city/{geoId}

Path parameters

geoIdstring required

the city's geoId

Response

Success

idstring

unique identifier

namestring

the city's name, depending on the language valid values are e.g. <em>"Müchen"</em> or <em>Munich</em>

stateCodestring

The code of the city's state. For most countries this is a two-digit numeric code, with which the state can be identified uniquely in the specific Country. The code can also be a String for other cities. Valid examples are <em>"CA"</em> or <em>"02"</em>

which in turn get uniquely identifiable when combined with the state's country:

<em>"US.CA"</em> for California, United States or <em>"DE.02"</em> for Bavaria, Germany

For a complete list of available states (that aren't necessarily used in this database) is available in <a href= "http://download.geonames.org/export/dump/admin1CodesASCII.txt">a textfile on geonames.org</a>.

Note that this code is only unique combined with the city's Country. The code alone is <strong>not</strong> unique.

statestring

The name of city's state, e.g. <em>"Bavaria"</em> or <em>"Florida"</em>

Example response

{
  "id": "5357527",
  "name": "Hollywood",
  "stateCode": "CA",
  "state": "California",
  "coords": {
    "long": -118.3267434,
    "lat": 34.0983425
  },
  "country": {
    "code": "US",
    "name": "United States"
  }
}