- Sign up at https://app.apilayer.com/ to receive your access key.
- Pick an API: Browse and choose an API from the hub catalog.
- Make your first call:
curl "https://api.apilayer.net/{product}/{endpoint}?access_key=YOUR_KEY&{params}"- Upgrade to a paid plan to unlock higher request volumes and premium features
Authentication
Every API in this catalog uses the same API Access Key. Send it in one of two ways:
access_keyquery parameter (recommended), for example?access_key=YOUR_ACCESS_KEYapikeyrequest header, for exampleapikey: YOUR_ACCESS_KEY
The gateway also accepts the key in an apikey query parameter or an access_key request header. Query parameter names are case-sensitive (APIKEY or Access_Key are not read). Other header names such as X-API-Key, and a key in a POST form body, are not read; the API then returns 401 (No API key found in request).
Send the key in one place only. If you send it in more than one, only one is used, in this order: apikey header, apikey query parameter, access_key header, access_key query parameter. If that one is wrong, the API returns 401 (Unauthorized), even when another key in the request is valid.
Keep your key server-side — never embed it in client code or public repositories.
Common API Errors
If your request to an APILayer API does not succeed, the API returns a JSON error response containing an error object with code and message fields indicating what went wrong. APIs also use standard HTTP status codes — 200 for success, and an appropriate 4xx or 5xx code for failures.
Note: A small number of products (ipstack, numverify, weatherstack) still return HTTP 200 with a
"success": falseflag and a numericcode. Refer to the product-specific error section in those API references.
Standard Error Response
{
"error": {
"code": "invalid_access_key",
"message": "An invalid API access key was supplied."
}
}Common Error Codes
| HTTP | Type | Description |
|---|---|---|
| 401 | invalid_access_key | An invalid API access key was supplied. |
| 401 | missing_access_key | No API access key was supplied. |
| 401 | inactive_user | The given user account is inactive. |
| 403 | function_access_restricted | The endpoint is not supported on your current subscription plan. |
| 403 | https_access_restricted | HTTPS access is not supported on your current subscription plan. |
| 404 | invalid_api_function | The given API endpoint does not exist. |
| 404 | 404_not_found | Resource not found. |
| 422 | validation_error | One or more request parameters failed validation. See context. |
| 429 | usage_limit_reached | Monthly request volume exceeded. |
| 429 | rate_limit_reached | Per-second / per-minute rate limit exceeded. |
| 500 | internal_error | An internal error occurred. Retry or contact support. |