Authentication
The Solcast API uses API keys to authenticate requests. Your API key carries full access to your account, so keep it secret and never expose it in client-side code or public repositories.
API keys
API keys are managed through the Solcast Toolkit. Each key is tied to your account and grants access to the products included within your plan.
Sending your API key
The recommended method is to pass your API key in the Authorization header of every request using the Bearer scheme.
Alternate: query string
If you cannot set request headers, you can pass your key as the api_key query parameter instead. Prefer the header method wherever possible — query strings may appear in server logs and browser history.
Requests made without a valid key, or with a key that lacks permission for the requested endpoint, will receive a 401 Unauthorizedor 403 Forbidden response.
Keeping your key secure
Authentication errors
When authentication fails, the API returns one of these status codes:
Unauthorized
No Authorization header was provided, or the key is malformed.
Forbidden
The key is valid but does not have permission to access this endpoint.
Authentication examples
How to send your API key
curl "https://api.solcast.com.au/data/forecast/radiation_and_weather" \
-H "Authorization: Bearer $API_KEY"const res = await fetch(
'https://api.solcast.com.au/data/forecast/radiation_and_weather',
{
headers: {
Authorization: `Bearer ${API_KEY}`,
},
}
);
const data = await res.json();import requests
response = requests.get(
"https://api.solcast.com.au/data/forecast/radiation_and_weather",
headers={"Authorization": "Bearer API_KEY"},
)
data = response.json(){
"response_status": {
"error_code": "Unauthorized"
}
}