API Access Key & Authentication


API Authentication

The first step to using the API is to authenticate with your weatherstack account's unique API access key, which can be found in your account dashboard after registration. To authenticate with the API, simply use the base URL below and pass your API access key to the API's access_key parameter.

Example API Request:

Sign Up to Run API Request

Keep it safe: Please ensure that you keep your API access key private and do not expose it in any publicly available part of your application. If you ever need to reset your key, simply visit your account dashboard to do so.

256-bit HTTPS Encryption

Users can connect to the weatherstack using industry-standard SSL (HTTPS) by attaching an s to the HTTP protocol as shown in the example API request below.

Example API Request:                                                                     Available on: All Plans

API Error Codes

Whenever an API request fails, the weatherstack API will return an error object in lightweight JSON format. Each error object contains an error code, an error type, and an info object containing details about the error that occurred. Below you will find an example error as well as a list of common API errors.

Example API Error:

Common API Errors:

CodeTypeInfo
404404_not_foundUser requested a resource which does not exist.
101unauthorizedUser did not supply an access key / invalid access key
429too_many_requestsUser has reached his subscription's monthly request allowance.
601missing_queryAn invalid (or missing) query value was specified.
603historical_queries_not_supported_on_planHistorical data is not supported on the current subscription plan.
604bulk_queries_not_supported_on_planBulk queries is not supported on the current subscription plan.
605invalid_languageAn invalid language code was specified.
606invalid_unitAn invalid unit value was specified.
607invalid_intervalAn invalid interval value was specified.
608invalid_forecast_daysAn invalid forecast days value was specified.
609forecast_days_not_supported_on_planWeather forecast data is not supported on the current subscription plan.
611invalid_historical_dateAn invalid historical date was specified.
612invalid_historical_time_frameAn invalid historical time frame was specified.
613historical_time_frame_too_longThe specified historical time frame is too long. (Maximum: 60 days)
614missing_historical_dateAn invalid historical date was specified.
615request_failedAPI request has failed.
616missing_latitudeMissing latitude value.
617missing_longitudeMissing longitude value.
618invalid_latitude_typeAn invalid latitude value was specified.
619invalid_longitude_typeAn invalid longitude value was specified.
620missing_historical_date_startMissing historical start date value.
621invalid_tideAn invalid tide value was specified.
622invalid_historical_date_startAn invalid historical start date value was specified.
623invalid_historical_date_endAn invalid historical end date value was specified.
624invalid_historical_date_rangeAn invalid date range was specified.

 

 

 

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