Data source: GeoNames.org
https://context.gnist.ai/rest/geonames/
AuthenticationAll requests require a Gnist-API-Key header (or api_key query parameter).
Free tier: 100 calls/day. Get your API key.
Tools (7)
search_citiesSearch for cities by name.
Args:
query: City name or partial name to search for.
country_code: Optional ISO-3166 country code to restrict the search (e.g. 'NO', 'US').
limit: Maximum number of results (default 10).
Returns:
Dictionary with 'data' list of matching cities, each with name, country_code,
latitude, longitude, population, timezone, and geonameid.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | required | |
country_code | any | optional | |
limit | integer | optional | (default: 10) |
{
"query": "example"
}get_cityGet a city by its GeoNames ID.
Args:
geonameid: The GeoNames ID of the city.
Returns:
Dictionary with city details, or an error if not found.
| Parameter | Type | Required | Description |
|---|---|---|---|
geonameid | integer | required |
{
"geonameid": 1
}get_countriesList all countries.
Returns:
Dictionary with 'data' list of all countries, each with iso_code, country_name,
capital, population, continent, currency_code, and languages.
{
"query": "example"
}get_countryGet a country by its ISO-3166 code.
Args:
iso_code: Two-letter ISO-3166 country code (e.g. 'NO', 'US', 'DE').
Returns:
Dictionary with country details, or an error if not found.
| Parameter | Type | Required | Description |
|---|---|---|---|
iso_code | string | required |
{
"iso_code": "example"
}search_timezonesSearch for timezones by ID or filter by country.
Args:
query: Optional partial timezone ID to search for (e.g. 'Europe').
country_code: Optional ISO-3166 country code to filter by (e.g. 'NO').
limit: Maximum number of results (default 10).
Returns:
Dictionary with 'data' list of matching timezones, each with timezone_id,
country_code, gmt_offset_jan, dst_offset_jul, and raw_offset.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | any | optional | |
country_code | any | optional | |
limit | integer | optional | (default: 10) |
{
"query": "example"
}get_timezoneGet a timezone by its IANA timezone ID.
Args:
timezone_id: IANA timezone ID (e.g. 'Europe/Oslo', 'America/New_York').
Returns:
Dictionary with timezone details, or an error if not found.
| Parameter | Type | Required | Description |
|---|---|---|---|
timezone_id | string | required |
{
"timezone_id": "example"
}report_feedbackReport a bug, feature request, or general feedback for this data source.
Use this when something doesn't work as expected, when you'd like
a new feature, or when you have suggestions for improvement.
Args:
feedback: Describe the issue or suggestion.
feedback_type: One of 'bug', 'feature_request', or 'general'.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: "general") |
{
"feedback": "example"
}Quick Start
curl -X POST "https://context.gnist.ai/rest/geonames/search_cities" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"query": "example"}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/rest/geonames/search_cities",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={
"query": "example"
},
)
print(resp.json())