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_KEYEndpoints
| GET endpoint | Purpose |
|---|---|
/v1/status | Backend status and model freshness |
/v1/countries | Supported country codes |
/v1/location | Resolve postal code and locality |
/v1/forecast | Retrieve potential indices |
/v1/account | Shared balance and participation |
/v1/usage | Recent 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=DN31When 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=24Customer 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
| HTTP | Meaning |
|---|---|
| 200 | Success |
| 400 | Invalid parameters |
| 401 | Missing or invalid key |
| 402 | Insufficient prepaid balance |
| 403 | Key not permitted |
| 404 | Not found |
| 409 | Idempotency conflict or expired replay |
| 429 | Rate or daily allowance limit |
| 503 | Forecast or service unavailable |
Respect Retry-After when supplied. No client library or public registration is required for the documented private test API.