Install
openclaw skills install @nanookai/countries-apiQuery the free countries.dev REST API (no API key needed) for country data (names, capitals, populations, currencies, languages, flags, borders, timezones), city/place search and reverse geocoding, postal/ZIP code lookup, IP geolocation, and distance between locations. Use this skill whenever the user asks about countries, capitals, country codes (ISO alpha-2/alpha-3), currencies by country, national flags, neighbouring countries, city coordinates, "which country is this IP in", ZIP/postal code lookups, or distances between cities — even if they don't mention countries.dev or an API by name.
openclaw skills install @nanookai/countries-apiA free, no-auth REST API for country, city, postal-code, and IP-geolocation
data. Base URL: https://countries.dev
curl/server code.# One country by ISO code (alpha-2 or alpha-3, case-insensitive)
curl https://countries.dev/alpha/JP
# Search by name (substring match, returns an array)
curl "https://countries.dev/name/japan?fields=name,capital,population"
# All countries, top 10 by population
curl "https://countries.dev/countries?fields=name,population&sort=population&order=desc&limit=10"
# Find a city and its coordinates
curl "https://countries.dev/cities?q=taipei&limit=5"
# Geolocate an IP
curl https://countries.dev/ip/8.8.8.8
| You need... | Use |
|---|---|
| One country, and you have its ISO code | /alpha/{code} (most reliable — prefer this) |
| One country by name | /name/{name} (substring match — may return several; pick the best match) |
| Lists filtered by region/currency/language/etc. | /region/…, /currency/…, /lang/…, etc. |
| Countries in a population or area range | /population?min=&max=, /area?min=&max= |
| A country's neighbours (full records) | /borders/{country name} — takes a name like germany, NOT an ISO code |
| City search / coordinates | /cities?q=… (ranked by population) |
| Any geographic feature (mountains, rivers…) | /places?q=…&class=… |
| Nearest city/place to coordinates | /cities/near?lat=&lng=, /places/near?lat=&lng= |
| ZIP/postal code → place + coordinates | /postal/{alpha2}/{code} |
| IP → country | /ip (caller), /ip/{ip}, or POST /ip for batches |
| Distance between two points | /distance?lat1=&lng1=&lat2=&lng2= or ?from=&to= (GeoNames IDs, not names) |
For the complete endpoint list, every query parameter, response schemas, and verified examples, read references/endpoints.md.
/alpha/JP → object;
/name/japan → [ {...} ].fields= aggressively. Full country records are large. Request
only what you need: ?fields=name,capital,population. Use ?fields=full
to get everything including altSpellings, maps, translations, and
regionalBlocs (these four are omitted by default).sort, order (asc/desc), limit,
offset for sorting and pagination./name/united returns every country
containing "united". Don't assume the first result is the intended one —
match on the name field or fall back to /alpha/{code} when you know
the code./borders takes a country name (/borders/germany works;
/borders/DE and /borders/DEU return 404 "Country not found"). To get
just neighbour codes, read the borders array (alpha-3 codes) from the
country record instead./distance does not accept city names or country codes — only
lat1/lng1/lat2/lng2 coordinates or GeoNames IDs via from/to. To get
the distance between two named cities, first resolve each via
/cities?q=name to get its geonameId, then call /distance?from=ID&to=ID.+ encoded,
e.g. /timezone/UTC%2B08:00.flag field is an emoji (🇹🇼); image URLs live in
flags.png / flags.svg (hosted on flagcdn.com).