Errors

Understanding API error responses
View as Markdown

Error responses

All errors follow a consistent format:

1{
2 "detail": [
3 {
4 "type": "error",
5 "msg": "description of what went wrong"
6 }
7 ]
8}

HTTP status codes

CodeMeaning
200Success
401Missing or invalid API key
403Your subscription does not include access to this ISO or tier
404Endpoint not found
422Invalid parameters — e.g., unknown region ID, invalid date range, or no data available for the requested combination
429Rate limit exceeded
500Internal server error — contact support if persistent

A 422 response can also mean no data is available for the requested target or time range. This is common when querying newly added regions or very recent time windows before the forecast has been generated.

Response compression

All responses over 1,000 bytes are automatically compressed with gzip. Make sure your HTTP client sends the Accept-Encoding: gzip header to benefit from reduced transfer sizes.

Best practices

  • Cache responses when possible. Forecasts are typically updated every 1–6 hours depending on the metric.
  • Use the header method (X-API-Key) for authentication to keep keys out of server access logs.
  • Request specific targets — use the id parameter to fetch individual regions or plants when you don’t need all of them.
  • Handle 422 gracefully — not all ISOs have data for all metrics or time ranges. Check the response before parsing.
  • Handle 429s with backoff — implement exponential backoff in production applications rather than fixed-interval retries.
  • Use the summary endpoint — if you need multiple metrics for a single ISO, GET /region/{iso}/summary returns everything in one call instead of multiple requests.