API Access Key & Authentication
API Access Key
After creating an Aviationstack account, you will be able to retrieve your unique API access key using your account dashboard. Each Aviationstack account can only be assigned one API access key.
To connect to the API, simply attach the access_key
parameter to any valid API endpoint URL and set it to your access key. Find an example below, you can click the button on the right side of the code to execute the shown API request.
Run API Request
Keep your key safe: To prevent unauthorized access to your aviationstack account, please make sure to keep your API access key safe at all times. You can always generate a new key using your account dashboard.
256-bit HTTPS Encryption
Customers registered for the Aviationstack with any plans may connect to the API using industry-standard 256-bit HTTPS
(SSL) encryption. You don’t need a paid plan to access the HTTPS
protocol anymore.
Example API Request Available on: All Plans
API Error Codes
If your request to the aviationstack API does not succeed, the API will return a JSON error response that contains an error code
and message
objects indicating the type of error that occurred. The API also supports HTTP
status codes, returning a code of 200
for successful requests, and an error status code (e.g. 404
) for failed requests.
If a validation error occurs, hence, an API parameter is used in an invalid way, there will be an additional context
object containing multiple sub-objects with the associated API parameter as the key and details about the given validation error(s), further sub-objects. Each instance of a validation error contains key
and message
objects.
Example Error
Common API Errors
Code | 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 given API endpoint is not supported on the current subscription plan. |
404 | invalid_api_function | The given API endpoint does not exist. |
404 | 404_not_found | Resource not found. |
429 | usage_limit_reached | The given user account has reached its monthly allowed request volume. |
429 | rate_limit_reached | The given user account has reached the rate limit. |
500 | internal_error | An internal error occurred. |