Country Lookup API - ISO Codes, Capital, Currency, Phone Prefix
Accepts a 2-letter ISO 3166-1 alpha-2 code, 3-letter alpha-3 code, or partial name match. Returns the country name, code, code3, numeric code, capital, currency code and name, phone prefix, continent, and flag emoji.
Code examples
curl -X POST https://api.botoi.com/v1/country/lookup \
-H "Content-Type: application/json" \
-d '{"query":"Japan"}'When to use this API
Fill a country dropdown with flags
Call the endpoint for each user-selected country and display the flag_emoji next to the name. No icon library required; emoji renders natively in every modern browser.
Derive default currency from country
When a user picks their shipping country, look it up and set the currency selector to currency_code. Much lighter than shipping a 200KB locale library.
Format phone inputs
Given a country from an address form, set the phone input prefix to phone_prefix. Combined with /v1/phone/validate, you catch most format errors before they hit your SMS provider.
Frequently asked questions
What matches are accepted?
How many countries are in the database?
Why is Kosovo not in the list?
Is the flag_emoji reliable across platforms?
What is the numeric code for?
Get your API key
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.