Free
For testing and side projects
$0forever
No credit card
No overage charges
100 requests / month
Includes:
- SSL Encryption (HTTPS)
- Access to /all endpoint: limited data
Real-Time Country Data API · by APILayer
Free plan · 100 requests / month · no card
Overview
Countrylayer is a reliable, real-time country data API used by thousands of developers to retrieve accurate information for any country in the world. It provides comprehensive details, including population, currencies, and languages, in a lightweight and portable JSON format.
curl --request GET \
--url "https://api.apilayer.net/countrylayer/v2/name/Germany?access_key=YOUR_ACCESS_KEY"
[
{
"name": "Germany",
"topLevelDomain": [
".de"
],
"alpha2Code": "DE",
"alpha3Code": "DEU",
"callingCodes": [
"49"
],
"capital": "Berlin",
"region": "Europe",
"subregion": "Western Europe",
"population": 83783942,
"area": 357022,
"languages": [
{
"iso639_1": "de",
"name": "German"
}
],
"currencies": [
{
"code": "EUR",
"name": "Euro"
}
],
"flag": "https://restcountries.eu/data/deu.svg"
}
]Access an accurate country database that is based on official information from each country. The data is updated in real-time to ensure your application always displays the most current facts, from population figures to time zones.
Retrieve extensive data points for any country, including geographical position, capital cities, calling codes, currencies, languages, flag images, and regional affiliations. This depth allows you to build rich, informative user interfaces or backend logic.
Query data exactly how you need it by searching via country name, capital city, currency, language, region, or ISO codes. This versatility supports diverse use cases, from form autocomplete to complex data analysis.
Integrate easily with a simple REST architecture that delivers data in portable JSON format, compatible with any programming language. All connections are secured with 256-bit SSL encryption to ensure your data streams remain safe.
Pricing
Start free. Upgrade when you go live.
For testing and side projects
$0forever
No credit card
No overage charges
100 requests / month
Includes:
For your first live product
$9.99/ month
Billed monthly
Then $0.15984 per extra request, up to 500 extra a month
250 requests / month
Everything in Free, plus:
For growing traffic
$49.99/ month
Billed monthly
Then $0.039992 per extra request, up to 10,000 extra a month
5,000 requests / month
Everything in Starter, plus:
For high volume
$149.99/ month
Billed monthly
Then $0.029998 per extra request, up to 40,000 extra a month
20,000 requests / month
Everything in Professional, plus:
+ 8 more
See all 12 featuresNeed more? Contact sales for custom needs.
| 12 features | Free$0Get free key | Starter$9.99/moSubscribe | Professional$49.99/moSubscribe | Enterprise$149.99/moSubscribe |
|---|---|---|---|---|
| SSL Encryption (HTTPS) | ||||
| Access to /all endpoint | limited data | limited data | limited data | full data |
| Access to /name endpoint | – | limited data | limited data | full data |
| Access to /currency endpoint | – | limited data | limited data | full data |
| Access to /alpha endpoint | – | limited data | limited data | full data |
| Access to /language endpoint | – | – | limited data | full data |
| Access to /capital endpoint | – | – | limited data | full data |
| Access to /region endpoint | – | – | – | full data |
| Access to /regionalbloc endpoint | – | – | – | full data |
| Access to /callingcode endpoint | – | – | – | full data |
| Full Data Access | – | – | – | |
| Standard Support | – | |||
| Price per extra request after the monthly limit | None | $0.15984 | $0.039992 | $0.029998 |
Playground
Build a request in your browser and see the response it returns.
Agents
Steps for AI coding agents that add Countrylayer to a project.
A person creates the account: an agent cannot sign up. Sign up at app.apilayer.com and subscribe to Countrylayer. The Free plan includes 100 requests / month and needs no credit card.
Copy the API key from the APILayer dashboard and give it to the agent as an environment variable (step 2).
Read the key from an environment variable named APILAYER_ACCESS_KEY. Do not write the key into source code, commit it to git, or paste it into a chat.
Call Countrylayer from server code. The key travels in the request URL, so a request sent from a browser shows the key to every visitor.
# add .env to .gitignore
APILAYER_ACCESS_KEY=your_api_keyhttps://api.apilayer.net/countrylayer/v2access_key query parameter/name/{name} Search by name/all All countriescurl "https://api.apilayer.net/countrylayer/v2/name/Germany?access_key=$APILAYER_ACCESS_KEY"The API info tab shows the response this request returns.
Each plan adds features to the plan before it. Check that the account's plan includes a feature before writing code that uses it.
| Plan | Requests / month | Adds |
|---|---|---|
| Free | 100 | SSL Encryption (HTTPS), Access to /all endpoint: limited data |
| Starter | 250 | Access to /name endpoint: limited data, Access to /currency endpoint: limited data, Access to /alpha endpoint: limited data, Standard Support |
| Professional | 5,000 | Access to /language endpoint: limited data, Access to /capital endpoint: limited data |
| Enterprise | 20,000 | Access to /all endpoint: full data, Access to /name endpoint: full data, Access to /currency endpoint: full data, Access to /alpha endpoint: full data, Access to /language endpoint: full data, Access to /capital endpoint: full data, Access to /region endpoint: full data, Access to /regionalbloc endpoint: full data, Access to /callingcode endpoint: full data, Full Data Access |
Prices are in the Pricing tab.
FAQs
Here are the answers you might be seeking
Countrylayer is a real-time REST API that provides accurate and up-to-date data for countries worldwide, including information on capitals, currencies, languages, and populations, delivered in a lightweight JSON format.
The API returns specific country details such as the capital city, region, population size, latitude/longitude coordinates, time zones, currency codes, languages, and flag images.
You can search for countries using various filters, including full or partial country names, capital cities, currency codes, ISO language codes, calling codes, or regions.
The countrylayer service provides common information about countries via a REST API. With this API, users will be able to get detailed information about countries in the world by filtering by name of a country, language, code, currency, the capital city, calling code, region, or regional bloc.
Countrylayer has its own database built based on official data from each country.
The API provides various data that can be found in the Documentation section.
Countrylayer supports more than 200 countries, meaning that it also supports the non-officially recognized countries.
Yes, all API requests from any plan are secured via 256-bit SSL encryption (HTTPS), ensuring that the data transmitted between your application and the API remains private and secure.
If you are logged in, you can find it in your Account Dashboard, in the 3-Step Quickstart Guide, and in all interactive links contained in the API’s Documentation. In your account dashboard you can reset your access key at any given time.
Pricing is based on the number of monthly API Requests offered for each individual Subscription Plan. Accessing any type of countrylayer data using a valid API Access Key counts as one “API Request”. Unlike most other providers, any API Endpoint or feature requested (including Time-Frame & Country Queries, as well as requesting multiple countries at once) counts as only one API Request.
The countrylayer API’s system status is closely monitored around the clock. Every effort is made to ensure the highest possible level of availability and consistency, and we are proud to have an average uptime rate of nearly 100% (99.9%), calculated based on the past 12 months.
Yes, Countrylayer offers a free plan that gives you instant access to the API with 100 searches a month, which include SSL encryption, making it ideal for testing and small-scale projects.
Yes. If you choose annual billing, the total price of your subscription plan will be up to 15% lower than the total amount you would pay with a monthly payment frequency.
If your usage consistently surpasses the set limits each month, you may face additional charges for the excess usage. Nevertheless, as your monthly usage reaches a certain threshold, it becomes more practical to consider upgrading to the next plan. By doing so, you ensure a smoother and more accommodating experience for your growing customer base.
Users will be automatically notified via e-mail and on their Account Dashboard once at least 75%, 90%, and 100% of their monthly API Request allowance has been reached. After reaching 100% of the allowance, overages fees will apply so we make sure you won’t experience any disruptions and your website/application will keep running smoothly.
An overage occurs when you go over a quota for your API plan. When you reach your API calls limit, we will charge you a small amount for each new API call so we can make sure there will be no disruption in the service we provide to you and your website or application can continue running smoothly.
Prices for additional API calls will vary based on your plan.
Overage fees allow customers to continue using an API once a quota limit is reached. We want to make sure your website or application continues running at all times, so charges will apply if you go over your monthly quota limit. If you notice you are going over your quota limit each month, look on your dashboard for an upgraded plan to help with larger request limits.
When you are close to reaching your API calls limit for the month, you will receive an automatic notification (at 75%, 90%, and 100% of your monthly quota). You can keep track of your quota usage to prevent overages by tracking the number of API calls you make and checking the dashboard for up-to-date usage statistics.
Still have a question?
Contact support