Getting Started


API Access Key & Authentication

The API uses a unique identifier, an API key, that is passed in the URL parameter access_key. This parameter serves as a unique identifying authentication with the Countrylayer API.

Base URL:

Append your API Key: See an example of how to authenticate the countrylayer API with the access_key parameter:

API Response

The data is returned in a standard JSON format and easily parsed in any programming language.

Example Response: See below an example of an API response that provides information about all the world's countries.

As we can see from the example response above, we are receiving different details regarding countries.

Available Endpoints

The API comes with a number of endpoints. Each of them provides different functionality. Please be aware that not all endpoints are available on every subscription plan.

Connecting via HTTPS

All subscription plans available for the countrylayer API come with support for 256-bit SSL encryption. To connect to the API via HTTPS, simply use the HTTPS protocol instead of standard HTTP.

Error Codes

Whenever a requested resource is not available or an API call fails for another reason, a JSON error is returned. Errors always come with an error code and a description.

Example Error: The following error is returned if your monthly API request volume has been exceeded.

Other Errors:

CodeTypeInfo

404

404_not_foundThe requested resource does not exist.

101

invalid_access_keyNo API Key was specified or an invalid API Key was specified.

103

invalid_api_functionThe requested API endpoint does not exist.

429

usage_limit_reachedThe maximum allowed API amount of monthly API requests has been reached.

 

 

Questions? Contact Sales .
Need help? Contact Support .
© 2025 APILayer. All rights reserved.