Place Hierarchy Webservices

The administrative and other hierarchies of places: the children of a place, all places above it, its neighbours and siblings, and the features it contains. The username parameter is required on every request.

See also: GeoNames webservices · all webservices on one table

Children

Returns the children (admin divisions and populated places) for a given geonameId. The children are the administrative divisions within an other administrative division, like the counties (ADM2) in a state (ADM1) or also the countries in a continent. The leafs are populated places, other feature classes like spots, mountains etc are not included in this service. Use the search service if you need other feature classes as well.

Url
http://api.geonames.org/children? or http://api.geonames.org/childrenJSON?

Parameters

ParameterValueDescription
geonameIdintegerthe geonameId of the parent
maxRowsinteger (optional)number of rows returned, default is 200
styleSHORT, MEDIUM, LONG, FULL (optional)verbosity of the returned document; default MEDIUM. With FULL each child carries its admin codes (adminCode1, adminCode2 ... down to the level of the child itself, for a second-order division its adminCode2) and admin names, and also its alternate names, time zone, bounding box and elevation; the document is much larger, so use it only when you need these
hierarchy'tourism', 'geography' or 'dependency' (optional)allows to use other hierarchies than the default administrative hierarchy: 'tourism' for tourism regions, 'geography' for geographical regions and 'dependency' for dependencies

Result

A list of GeoName records, as XML or JSON. The admin codes of the children (adminCode2 of a second-order division, for example) are only in the FULL style.

Examples

Regions of ItalyMunicipalities of the canton of Echternach, Luxembourg, with their admin codesTourism hierarchy: islands of the CanariesDependency hierarchy: dependencies of the UKGeographic hierarchy: regions of HK

Hierarchy

Returns all GeoNames higher up in the hierarchy of a place name.

Url
http://api.geonames.org/hierarchy? or http://api.geonames.org/hierarchyJSON?

Parameters

ParameterValueDescription
geonameIdintegerthe geonameId for the hierarchy

Result

A list of GeoName records, ordered by hierarchy level. The top hierarchy (continent) is the first element in the list.

Example

Hierarchy of Zurich, Switzerland, Europe

Neighbours

Returns all neighbours for a country or administrative division. Coverage: all countries on country level, and lower levels as specified in the supported levels.

Url
http://api.geonames.org/neighbours? or http://api.geonames.org/neighboursJSON?

Parameters

ParameterValueDescription
geonameIdintegerthe geonameId for the neighbours (country or ADM)
countrystringthe country code (alternative parameter instead of the geonameId)

Result

The neighbours of a toponym, currently only implemented for countries.

Example

Neighbours of Switzerland

Contains

Returns all features within the GeoName feature for the given geonameId. It only returns contained features when a polygon boundary for the input feature is defined.

Url
http://api.geonames.org/contains? or http://api.geonames.org/containsJSON?

Parameters

ParameterValueDescription
geonameIdintegerthe geonameId for the enclosing feature
featureClassstring (optional)filter by featureClass
featureCodestring (optional)filter by featureCode

Result

The enclosed features (only when a polygon boundary is available).

Example

Features on the island of Texel

Siblings

Returns all siblings of a GeoNames toponym with feature class A.

Url
http://api.geonames.org/siblings? or http://api.geonames.org/siblingsJSON?

Parameters

ParameterValueDescription
geonameIdintegerthe geonameId for the siblings

Result

A list of GeoNames records (feature class A) that have the same administrative level and the same father.

Example

Siblings of France