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
Code | Type | Description |
---|---|---|
401 | Unauthorized | Check your access key or activity of the account |
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 | too_many_requests | 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. |
Note: The API is limited to 5 requests per second.