Skip to main content

Volatile Forecast SDK

Python client for authenticated access to forecast dataset queries on the Volatile public GraphQL API. It focuses on a small, typed surface (execute_dataset_query, my_datasets, me, token lifecycle) with client-side validation so integrators pick only supported bidding zones, IANA time zones, percentile fields, and aggregation modes.

About Volatile

Volatile is an energy intelligence company focused on making European power-market data and forecasting workflows easier to consume and operationalize.
This SDK is one of the tools provided to help customers integrate Volatile forecast products directly into Python-based analytics, trading, and automation pipelines.

Install

From PyPI (recommended):

pip install volatile-forecast-sdk

Runtime dependency: tzdata (IANA zone database for zoneinfo on all platforms).

Usage examples (login, dataset listing, query execution, and token-only auth) are available in examples/.

License and access model

This SDK is open source under the Apache-2.0 license and is publicly installable.

API usage still requires a valid Volatile customer account and API credentials. The license for this SDK does not grant free API access, and API use is governed by your contract and applicable API Terms of Service.

API endpoint

VolatileForecastClient() targets production by default (https://api.volatile.de). You can override base_url when needed:

from volatile_forecast_sdk import VolatileForecastClient, DEFAULT_BASE_URL

client = VolatileForecastClient()  # same as VolatileForecastClient(DEFAULT_BASE_URL)
client = VolatileForecastClient("https://api.staging.example.com")

Existing access token, same default:

client = VolatileForecastClient.from_token("eyJ...")  # optional: base_url="https://..."

from_token() accepts the token first, with base_url as an optional keyword argument.

Discover parameters (PFM datasets)

For products such as Volatile Load PFM-1, Volatile Spot PFM-1, and Volatile IDC DAS-1, the SDK ships a structured catalog that mirrors the server rules (zone, issue time, and dataset-specific optional keys):

from volatile_forecast_sdk import format_parameter_hints, list_catalog_dataset_names

print(list_catalog_dataset_names())
print(format_parameter_hints("Volatile Load PFM-1"))

Use ForecastQueryParams for a fluent builder with validation and tab-friendly enums:

from volatile_forecast_sdk import (
    VolatileForecastClient,
    ForecastQueryParams,
    EuropeanBiddingZone,
    CommonTimeZone,
    ForecastPercentileField,
    TimeAggregation,
)

client = VolatileForecastClient()
client.login("user", "pass")

params = (
    ForecastQueryParams.for_dataset("Volatile Load PFM-1")
    .with_zone(EuropeanBiddingZone.NO_2)
    .with_time_zone(CommonTimeZone.EUROPE_BERLIN)
    .with_forecast_issue_latest()
    .with_fields(ForecastPercentileField.P50, ForecastPercentileField.P90)
    .with_aggregation(TimeAggregation.FIFTEEN_MINUTES)
    .with_forecast_horizon_hours(168)
)

result = client.execute_dataset_query(name="Volatile Load PFM-1", parameters=params)
rows = result.parsed_rows()

.with_forecast_horizon_hours(h) takes 1-353 hours; .with_forecast_horizon_full() returns every step the served forecast has, without naming a number.

IDC DAS example (lean parameter set):

from volatile_forecast_sdk import CommonTimeZone, EuropeanBiddingZone, ForecastQueryParams

params = (
    ForecastQueryParams.for_dataset("Volatile IDC DAS-1")
    .with_zone(EuropeanBiddingZone.DE_LU)
    .with_time_zone(CommonTimeZone.EUROPE_BERLIN)
    .with_forecast_issue_latest()
)
result = client.execute_dataset_query(name="Volatile IDC DAS-1", parameters=params)

European bidding zones are exposed as EuropeanBiddingZone and EUROPEAN_BIDDING_ZONE_CODES (ENTSO-E-style strings). Time zones use CommonTimeZone presets plus validate_time_zone("Europe/Stockholm") against the full IANA set (zoneinfo.available_timezones()).

Refresh token policy

VolatileForecastClient applies a default RefreshTokenPolicy:

  • Proactive: if the access token looks like a JWT, refresh when wall-clock time is within leeway_seconds of exp (requires a refresh token from login).
  • Reactive: on HTTP 401 or GraphQL errors that look like auth failures, refresh once (configurable) and retry.

Disable automation (manual refresh only):

from volatile_forecast_sdk import VolatileForecastClient, RefreshTokenPolicy

client = VolatileForecastClient(refresh_token_policy=RefreshTokenPolicy(enabled=False))

Tune behavior:

RefreshTokenPolicy(
    enabled=True,
    leeway_seconds=300,
    max_reactive_refreshes=2,
    proactive_refresh=True,
    reactive_refresh_on_graphql_auth_error=True,
)

Helpers: client.access_token_expires_at_unix(), decode_jwt_exp_unix(token) (the signature is not verified, the value is only meant for scheduling).

Optional credentials_provider for fully-unattended processes

Pass a callable that returns (username, password) to let the SDK recover from a hard auth failure (e.g. refresh-token expiry or server-side session revocation) without operator intervention:

import os
from volatile_forecast_sdk import VolatileForecastClient

client = VolatileForecastClient(
    credentials_provider=lambda: (
        os.environ["VOLATILE_USERNAME"],
        os.environ["VOLATILE_PASSWORD"],
    ),
    max_relogins_per_hour=4,   # default, caps password-grant volume
)
client.login(os.environ["VOLATILE_USERNAME"], os.environ["VOLATILE_PASSWORD"])

The provider only fires when reactive-refresh can't recover; a hard cap of max_relogins_per_hour defends the auth endpoint from password-grant storms if the API gets stuck in a misconfigured state.

Observability: client.metrics

Every client exposes a plain-dict metrics attribute customers can sample at any time and feed into Prometheus / structlog / etc:

client.metrics
# {"request_count": 42, "request_errors": 0,
#  "token_refreshes": 1, "rate_limit_retries": 0, "relogins": 0}

The counters are best-effort (no locking). Reset by assigning a fresh dict if you want windowed metrics.

Rate-limit retries (HTTP 429)

The public API enforces per-user, per-operation budgets. When you exceed a budget it replies with HTTP 429 plus a Retry-After header. The SDK detects this automatically, sleeps the indicated number of seconds, and retries, up to max_rate_limit_retries times. Each sleep is capped at rate_limit_retry_cap_seconds so a misbehaving server can't pin your process indefinitely.

client = VolatileForecastClient(
    access_token="...",
    max_rate_limit_retries=3,           # default
    rate_limit_retry_cap_seconds=60.0,  # default
)

If the budget is exhausted, the SDK raises RateLimitError, a subclass of HTTPError that carries the parsed metadata, so you can decide what to do next:

from volatile_forecast_sdk import RateLimitError

try:
    client.execute_dataset_query(name="Volatile IDC DAS-1", parameters=params)
except RateLimitError as e:
    # e.retry_after, e.tier, e.window, e.limit, e.operation
    log.warning("Throttled on %s (%s): wait %ss", e.operation, e.window, e.retry_after)
    raise

Set max_rate_limit_retries=0 to disable the built-in loop entirely (useful if you want to handle 429s with your own scheduler).

Classic dict parameters

You can still pass a plain mapping (no validation beyond the API):

from volatile_forecast_sdk import VolatileForecastClient, normalize_bidding_zone, validate_time_zone

client = VolatileForecastClient()
client.login("user", "pass")

params = {
    "forecast_issue_time": "latest",
    "zone_code": normalize_bidding_zone("NO_2"),
    "time_zone": validate_time_zone("Europe/Berlin"),
}
result = client.execute_dataset_query(name="Volatile Spot PFM-1", parameters=params)

Forecast versions: forecast_created_at

forecast_issue_time is the forecast label (hourly). Several versions can exist behind one label. The API reports the creation time of the served version as forecast_created_at (ISO 8601, UTC, +00:00, second precision). Version selection is deterministic:

  • "latest": newest label, then newest version of that label;
  • an explicit forecast_issue_time: newest label at or before it, then its newest version;
  • every quantile column of a response comes from the same version.

For day-ahead prices, a delivery day is final once its auction has closed, at 12:00 Brussels time on the day before. From then on every request returns the same forecast for that day, the last one published before the gate closure; later delivery days keep updating.

To receive settled prices, with_fields(..., DayAheadPriceField.ACTUAL) adds the column electricity_price_actual, the settled day-ahead auction price per delivery period, None where no auction result exists yet. It is not returned by default and only available if enabled for your account.

To detect forecast updates, key your de-duplication on the pair (forecast_issue_time, forecast_created_at), not on the label alone. An update keeps the label and bumps forecast_created_at; for a given label the value never decreases.

result = client.execute_dataset_query(name="Volatile Spot PFM-1", parameters=params)
key = (result.forecast_issue_time, result.forecast_created_at)
if key != last_delivered_key:
    deliver(result.parsed_rows())
    last_delivered_key = key

forecast_created_at is None for IDC DAS datasets.

For a point-in-time view, ForecastQueryParams.with_forecast_created_before(when) serves the newest version created at or before when, combined with latest or an explicit issue time. Use it for replays and backtests that must see the forecast as of that moment.

API reference (high level)

Symbol Role
VolatileForecastClient GraphQL HTTP client, token policy, execute_dataset_query
DEFAULT_BASE_URL Production API root (https://api.volatile.de); pass a different base_url to override
ForecastQueryParams Validated fluent builder for query parameters
EuropeanBiddingZone, EUROPEAN_BIDDING_ZONE_CODES, normalize_bidding_zone Curated bidding-zone codes
CommonTimeZone, validate_time_zone, list_common_european_time_zones IANA time zones
ForecastPercentileField, IDCField, TimeAggregation Allowed fields / aggregation values
ForecastStatus Per-slot forecast-quality enum (0..7) returned by IDC datasets, see Forecast quality below
format_parameter_hints, parameter_hints_for_dataset, STANDARD_FORECAST_DATASETS, IDC_DAS_DATASETS, STANDARD_PFM_DATASETS Documentation-oriented catalog
RefreshTokenPolicy, decode_jwt_exp_unix Token lifecycle
DatasetQueryResult.parsed_rows() Normalize row JSON strings vs objects
DatasetQueryResult.forecast_created_at Creation time of the served forecast version (see Forecast versions)

The SDK mirrors the public GraphQL schema exposed by https://api.volatile.de/graphql/.

Forecast quality (IDC datasets)

IDC DAS datasets attach a per-slot quality label so consumers can filter or weight the forecast. Two columns are returned alongside the quantile / MC fields:

  • forecast_status (int 0..7): see the table below.
  • in_scope (bool): true for ID1 slots in the 1 to 6 h horizon (the MC layer's active scope). false for ID3 slots or ID1 slots outside that window; the MC columns (signal, expected_edge, p_buy, p_sell and the others) are null by design, which is not a degradation. The LightGBM quantile columns (id1_p10/50/90, id3_p10/50/90) are populated regardless.
forecast_status Name Meaning
0 OK All inputs fresh; VWAP-S0 (≤6 h) or DA-S0 (>6 h by design)
1 OK_DA_FALLBACK ≤6 h slot, no VWAP, crawler is fresh: liquidity gap, DA-S0 used
2 OK_IDA_FALLBACK Same as 1 but the intraday auction is newer than DA, so IDA-S0 is used
3 WATCH Non-critical input source stale OR borderline VWAP age (15 to 30 min)
4 VWAP_STALE VWAP older than 30 min, likely crawler lag
5 IMPUTED LightGBM substituted defaults for one or more missing features; data feed is fresh, model output is mildly biased
6 STALE_CRITICAL Data feed itself is stale: EPEX continuous-trades crawler down within MC scope, or day-ahead price missing for the delivery date
7 FAILED LightGBM produced NaN at this slot (model load / feature build failure)

Statuses are monotonically worse: higher is more degraded. Suggested thresholds:

  • LightGBM-only traders: skip slots with forecast_status >= 5.
  • MC-signal traders: skip slots with forecast_status >= 4.
  • Conservative consumers: only trade forecast_status <= 1.

Market reference (VWAP)

IDC DAS datasets also return the live continuous-trades VWAP that the MC signal is anchored to, so you can see the signal and its price basis together:

  • vwap (EUR/MWh): the most recent EPEX SIDC continuous-trades VWAP (epex_api_live, quarter-hourly product) for the delivery slot. This is the same S0 anchor the Monte-Carlo signal is built on. null for slots not yet traded (typically the far end of the horizon).
  • vwap_observed_at: the 5-minute execution-time bucket that VWAP was observed in, rendered in the query's time_zone and labelled by the bucket start: vwap_observed_at = 2026-07-15T07:05:00 means the trades executed in the 07:05:00 to 07:10:00 window. Use it to judge the VWAP's age; that age is exactly what forecast_status grades (OK, then WATCH, then VWAP_STALE).

Both are opt-in via fields and included when fields is omitted. vwap is the live low-latency tape, not the delayed settled FTP feed.

Classifier signals (added 0.7.0)

Six per-product classifier outputs from the forecasting model, returned per delivery slot alongside the quantiles:

  • id1_spike_prob, id3_spike_prob: probability that the product's ID minus DA spread lands in the top decile of historical magnitudes ("spike"). Populated across the full forecast horizon. Useful for widening expected ranges or de-risking around volatile slots.
  • id1_direction_prob, id3_direction_prob: probability that the product's index settles above the live VWAP anchor (the same vwap field above). > 0.5 means the model expects the price to move up from the current market level, < 0.5 down.
  • id1_conviction, id3_conviction: |direction_prob - 0.5|, the model's own sizing input: how far from a coin flip the direction call is.

Coverage: null is expected, not a degradation. The direction/conviction models exist per (product, hours-to-delivery) cell: id1 1 to 3 h, id3 3 to 5 h to delivery. Outside those windows the fields are null because no routing model covers that horizon. spike_prob has no such restriction.

All six are opt-in via fields and included when fields is omitted (IDCField.ID1_SPIKE_PROB, IDCField.ID1_DIRECTION_PROB, IDCField.ID1_CONVICTION, and the ID3_* counterparts).

Difference between status 5 and status 6

These are the two most commonly confused values, and they imply different operational responses:

  • 5 IMPUTED: the model improvised. Input features had one or more NaNs at inference time and the wrapper substituted a default (categorical missing-path, Ridge median, or analytical_cf=0). The data feed is fresh; only some engineered features were unavailable. Forecast is in the right ballpark; reduce position sizing.
  • 6 STALE_CRITICAL: the data feed stopped. The EPEX continuous- trades crawler is stale within the MC horizon, or the day-ahead price is missing entirely. The model may have produced a number, but it's reflecting old or absent market reality. Skip the slot.
from volatile_forecast_sdk import (
    ForecastQueryParams, ForecastStatus, IDCField, VolatileForecastClient,
)

params = (
    ForecastQueryParams.for_dataset("Volatile IDC DAS-1")
    .with_zone("DE_LU")
    .with_forecast_issue_latest()
    .with_fields(
        IDCField.ID1_P50, IDCField.ID3_P50,
        IDCField.SIGNAL, IDCField.EXPECTED_EDGE,
        IDCField.FORECAST_STATUS, IDCField.IN_SCOPE,
    )
)
result = client.execute_dataset_query(
    name="Volatile IDC DAS-1", parameters=params,
)
rows = [
    r for r in result.parsed_rows()
    if r.get("in_scope") and int(r.get("forecast_status", 7)) < ForecastStatus.VWAP_STALE
]

Metadata

Release files for volatile-forecast-sdk 0.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for volatile-forecast-sdk 0.11.0
File Size Uploaded Provenance Actions
volatile_forecast_sdk-0.11.0.tar.gz 51.2 kB Without provenance Details for volatile_forecast_sdk-0.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for volatile-forecast-sdk 0.11.0
File Interpreter ABI Platform Actions
volatile_forecast_sdk-0.11.0-py3-none-any.whl Python 3 none any Details for volatile_forecast_sdk-0.11.0-py3-none-any.whl

Total release size: 92.5 kB

Release files / volatile_forecast_sdk-0.11.0.tar.gz

Download URL volatile_forecast_sdk-0.11.0.tar.gz
Size 51.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8482cc79f1e7a924455b0c54118a4ceadec6655221ccb407a98d83e4d78d7c77
BLAKE2b-256 checksum
How to use checksums
fa34753543ea1bc647e5c98006c1783703f803c607b83f8b83afe8657cb30fbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / volatile_forecast_sdk-0.11.0-py3-none-any.whl

Download URL volatile_forecast_sdk-0.11.0-py3-none-any.whl
Size 41.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e43877cd22974c7d14eff5704fb104147dc092ae6cf0576e35b2c20cff6e8d0
BLAKE2b-256 checksum
How to use checksums
fd4c609332a26c7c3be00c5e59c6d0579f4d6b51315c60aed59d2a5f2e65d0e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for volatile-forecast-sdk 0.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page