Developer documentation

Build with renewable potential.

A compact HTTPS JSON API for location resolution, forecast retrieval and account information. The API is currently available to administrator-issued test keys only.

Authentication

Base URL: https://api.powerbyweather.com. Use HTTPS and an issued Bearer key. Keep the secret in a server-side environment variable or secure credential store; never expose it in URLs or browser JavaScript.

Authorization: Bearer YOUR_API_KEY

Endpoints

GET endpointPurpose
/v1/statusBackend status and model freshness
/v1/countriesSupported country codes
/v1/locationResolve postal code and locality
/v1/forecastRetrieve potential indices
/v1/accountShared balance and participation
/v1/usageRecent successful request receipts

Resolve a location

curl -G 'https://api.powerbyweather.com/v1/location' \
  -H "Authorization: Bearer $PBW_API_KEY" \
  --data-urlencode country=GB \
  --data-urlencode postcode=DN31

When ambiguous is true, choose among candidates or supply a matching locality. Store the returned cell ID for subsequent forecasts. A prefix match means reduced precision.

Request a forecast

RID=$(cat /proc/sys/kernel/random/uuid)
curl -G 'https://api.powerbyweather.com/v1/forecast' \
  -H "Authorization: Bearer $PBW_API_KEY" \
  -H "Idempotency-Key: $RID" \
  --data-urlencode cell_id=8419407ffffffff \
  --data-urlencode mode=combined \
  --data-urlencode access=free \
  --data-urlencode hours=24

Customer keys use access=free with 24 hours, or explicitly access=paid with 48 hours. Manual keys omit access and default to 48 hours (24 also supported). Modes: solar, wind, combined. Every interval is UTC, with solar averaged over the interval and wind sampled at its end.

Safe retry behaviour

Generate one unique idempotency key per logical forecast request (16–128 ASCII letters, digits, periods, underscores, colons or hyphens). Reuse it on retry with identical parameters. A replay within 24 hours returns the original receipt without another deduction or award. Expired replay or different parameters returns 409. Do not prefetch forecast routes: successful requests have accounting effects.

Response codes

HTTPMeaning
200Success
400Invalid parameters
401Missing or invalid key
402Insufficient prepaid balance
403Key not permitted
404Not found
409Idempotency conflict or expired replay
429Rate or daily allowance limit
503Forecast or service unavailable

Respect Retry-After when supplied. No client library or public registration is required for the documented private test API.