Skip to main content
GET
/
formulas
/
{id}
/
Retrieve formula details
curl --request GET \
  --url https://sandbox.prezio.eu/api/formulas/{id}/ \
  --header 'Authorization: <api-key>'
{
  "id": 1,
  "name": "Swedish Peak Power Charge - High Load Period",
  "key": "se_peak_highlast",
  "formula_definition": "peak_demand * rate",
  "input_requirements": [
    {
      "input_type": "TIME_SERIES",
      "key": "consumption_profile",
      "name": "Consumption Profile",
      "description": "Hourly consumption time series data",
      "input_unit_measurement": "KWH",
      "input_unit_period": null,
      "input_unit_display": "per kWh",
      "accepted_interval_minutes": [
        15,
        30,
        60
      ]
    }
  ],
  "parameters": [
    {
      "id": 1,
      "name": "Peak Demand - High Load",
      "key": "peak_demand",
      "aggregation": {
        "id": 10,
        "name": "SE Peak Demand - High Load Period",
        "function": "peak",
        "function_description": "Peak aggregation (top N values)",
        "config": {
          "peaks_count": 3,
          "distinct_interval_minutes": 1440,
          "peaks_function": "avg"
        },
        "per_interval_formula": "",
        "aggregation_expression": "avg(top_n(max_per_period(x, 1440), 3))",
        "tou_filters": [
          {
            "tou_manual": [
              {
                "months": [
                  11,
                  12,
                  1,
                  2,
                  3
                ],
                "days": [
                  1,
                  2,
                  3,
                  4,
                  5
                ],
                "start_time": "07:00",
                "end_time": "20:00"
              }
            ],
            "weight": 1,
            "is_opposite": false
          },
          {
            "tou_manual": [
              {
                "months": [
                  11,
                  12,
                  1,
                  2,
                  3
                ],
                "days": [
                  1,
                  2,
                  3,
                  4,
                  5
                ],
                "start_time": "07:00",
                "end_time": "20:00"
              }
            ],
            "weight": 0,
            "is_opposite": true
          },
          {
            "calendar_id": 456,
            "weight": 0.5
          }
        ],
        "lookback_frequency": "monthly"
      }
    },
    {
      "id": 2,
      "name": "Rate",
      "key": "rate",
      "aggregation": {
        "id": 11,
        "name": "Tariff Rate Input",
        "function": "sum",
        "function_description": "Sum of all values",
        "config": {},
        "per_interval_formula": "",
        "tou_filters": [],
        "lookback_frequency": ""
      }
    }
  ],
  "usage": {
    "summary": {
      "total_components": 15,
      "total_tariffs": 8,
      "component_types": [
        "DEMAND"
      ]
    },
    "details": [
      {
        "tariff_id": "tar_45",
        "tariff_name": "Business Low Voltage",
        "component_id": "com_1889",
        "component_name": "Winter Peak Demand",
        "component_key": "winter_peak",
        "calculation_input": "peak_demand",
        "has_tariff_tou": true,
        "has_tiers": false
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Token-based authentication with required prefix "Token"

Path Parameters

id
string
required

Formula ID

Response

200 - application/json

OK

Complete formula configuration with all parameter details.

Provides everything needed to understand what time series data and calculation inputs are required for this formula.

id
string
required

Unique identifier for this formula

name
string
required

Human-readable formula name

formula_definition
string
required

SymPy formula expression. Built-in variables: 'days' (billing period days)

parameters
object[]
required

List of all parameters used in this formula

input_requirements
object
required

Time series input requirements for this formula

usage
object
required

Component usage information (when include_usage=true)