API Access Key & Authentication


API Authentication

For every API request you make, you will need to make sure to be authenticated with the API by passing your API access key to the API's access_key parameter. You can find an example below.

Example API Request

Sign Up to Run API Request

Important: Please make sure not to expose your API access key publicly. If you believe your API access key may be compromised, you can always reset in your account dashboard.

256-bit HTTPS Encryption 

If you're subscribed to either the free or any paid plans, you will be able to access the Marketstack API using industry-standard HTTPS. To do that, simply use the https protocol when making API requests.

Example API Request                                                                            Available on: All Plans

API Error Codes

API errors consist of error code and message response objects. If an error occurs, the marketstack will return HTTP status codes, such as 404 for "not found" errors. If your API request succeeds, a status code 200 will be sent.

For validation errors, the marketstack API will also provide a context response object returning additional information about the error that occurred in the form of one or multiple sub-objects, each equipped with the name of the affected parameter as well as key and message objects. You can find an example error below.

Example Error

 

Common API Errors

CodeTypeDescription
401UnauthorizedCheck your access key or activity of the account
403function_access_restrictedThe given API endpoint is not supported on the current subscription plan.
404invalid_api_functionThe given API endpoint does not exist.
404404_not_foundResource not found.
429too_many_requestsThe given user account has reached its monthly allowed request volume.
429rate_limit_reachedThe given user account has reached the rate limit.
500internal_errorAn internal error occurred.

Note: The API is limited to 5 requests per second.

 

 

Was this page helpful?
Questions? Contact Sales .
Need help? Contact Support .
Check out our Changelog .
© 2025 APILayer. All rights reserved.