Countrylayer

Operational

Real-Time Country Data API · by APILayer

  • Business
  • JSON
  • 256-bit SSL
  • 24/7 support
Get your API key

Free plan · 100 requests / month · no card

Overview

API info

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.

Example request

GETShellcurl
curl --request GET \
  --url "https://api.apilayer.net/countrylayer/v2/name/Germany?access_key=YOUR_ACCESS_KEY"
Run it in the Playground

Example response

200 - OK
[
    {
        "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"
    }
]

Features

  • Reliable real-time data

    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.

  • Comprehensive country details

    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.

  • Flexible search options

    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.

  • Secure & developer-friendly

    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

Flexible plan for every stage of growth

Start free. Upgrade when you go live.

MonthlyYearlySave up to 15%

Free

For testing and side projects

$0forever

No credit card

No overage charges

Get free API key

100 requests / month

Includes:

  • SSL Encryption (HTTPS)
  • Access to /all endpoint: limited data
See all 12 features

Starter

For your first live product

$9.99/ month

Billed monthly

Then $0.15984 per extra request, up to 500 extra a month

Subscribe now

250 requests / month

Everything in Free, plus:

  • Access to /name endpoint: limited data
  • Access to /currency endpoint: limited data
  • Access to /alpha endpoint: limited data
  • Standard Support
See all 12 features
Most popular

Professional

For growing traffic

$49.99/ month

Billed monthly

Then $0.039992 per extra request, up to 10,000 extra a month

Subscribe now

5,000 requests / month

Everything in Starter, plus:

  • Access to /language endpoint: limited data
  • Access to /capital endpoint: limited data
  • 20× the requests of Starter
  • Lower cost per request
See all 12 features

Enterprise

For high volume

$149.99/ month

Billed monthly

Then $0.029998 per extra request, up to 40,000 extra a month

Subscribe now

20,000 requests / month

Everything in Professional, plus:

  • Access to /all endpoint: full data
  • Access to /name endpoint: full data
  • Access to /currency endpoint: full data
  • Access to /alpha endpoint: full data

+ 8 more

See all 12 features

Custom

Need more? Contact sales for custom needs.

Contact us

Compare all features

12 featuresFree$0Get free keyStarter$9.99/moSubscribeProfessional$49.99/moSubscribeEnterprise$149.99/moSubscribe
SSL Encryption (HTTPS)
Access to /all endpointlimited datalimited datalimited datafull data
Access to /name endpoint–limited datalimited datafull data
Access to /currency endpoint–limited datalimited datafull data
Access to /alpha endpoint–limited datalimited datafull data
Access to /language endpoint––limited datafull data
Access to /capital endpoint––limited datafull 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 limitNone$0.15984$0.039992$0.029998

Playground

Try the API

Build a request in your browser and see the response it returns.

GET

Add your free API key to run it from your code.

curl
200 - OK

      
    

Agents

Agents: start here

Steps for AI coding agents that add Countrylayer to a project.

  1. 1Get an API key

    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).

  2. 2Keep the key out of code

    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.

    .env
    # add .env to .gitignore
    APILAYER_ACCESS_KEY=your_api_key
  3. 3Make the first request

    Base URL
    https://api.apilayer.net/countrylayer/v2
    Auth
    access_key query parameter
    Formats
    JSON
    Endpoints
    • /name/{name} Search by name
    • /all All countries
    Shell
    curl "https://api.apilayer.net/countrylayer/v2/name/Germany?access_key=$APILAYER_ACCESS_KEY"

    The API info tab shows the response this request returns.

  4. 4Check the plan before you use a feature

    Each plan adds features to the plan before it. Check that the account's plan includes a feature before writing code that uses it.

    PlanRequests / monthAdds
    Free100SSL Encryption (HTTPS), Access to /all endpoint: limited data
    Starter250Access to /name endpoint: limited data, Access to /currency endpoint: limited data, Access to /alpha endpoint: limited data, Standard Support
    Professional5,000Access to /language endpoint: limited data, Access to /capital endpoint: limited data
    Enterprise20,000Access 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.

  5. 5Use the machine-readable docs

FAQs

Need clarity?

Here are the answers you might be seeking

Data & features

01.What is the Countrylayer API?

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.

02.What kind of data does the API provide?

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.

03.How can I search for specific countries?

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.

04.What is countrylayer?

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.

05.How accurate is countrylayer data and where does it come from?

Countrylayer has its own database built based on official data from each country.

06.Which country data does the API provide?

The API provides various data that can be found in the Documentation section.

07.Which countries are supported by the API?

Countrylayer supports more than 200 countries, meaning that it also supports the non-officially recognized countries.

API access

01.Does Countrylayer support secure connections?

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.

02.How do I get an API access key?

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.

03.What is an API request?

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.

04.What is the API’s uptime?

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.

Plans & pricing

01.Is there a free version of Countrylayer?

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.

02.Can I also pay yearly?

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.

03.What if I consistently have more API calls than my plan allows?

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.

Overages

01.What happens if I exceed my API request volume?

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.

02.What is an overage?

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.

03.Why does APILayer have overage fees?

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.

04.How do I know if I will be charged for overages?

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