Get a GeoNames hierarchy
geonames_get_hierarchyReturn the parent chain of a GeoNames feature, ordered from Earth and its continent through the country and admin divisions down to the feature itself, each with its geonameId, feature code, and coordinates. Use it to find which country, state, and county contain a place, or to fill an admin path for a geonameId. An unknown id returns found: false. Costs 1 GeoNames credit; cached.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| geonameId | Yes | GeoNames feature id, a positive integer up to 2147483647 such as 5809844 (Seattle), as returned in geonameId by the other geonames tools. A geonames.org/<id> URL is reduced to its id. | |
| geonamesUsername | No | Your own GeoNames username, so the call spends that account's free credits instead of the server's. Omit it to use the server's account. The account needs free web services enabled on its geonames.org account page. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | No | Administrative ancestors, Earth first and the requested feature last; empty when found is false. Levels a feature does not sit under are skipped. | |
| error | No | Present when the call failed. Absent on success. | |
| found | No | False when GeoNames has no feature with this geonameId. | |
| guidance | No | What to do next; present only when found is false. | |
| geonameId | No | The geonameId that was requested. |