The /live/ endpoint provides current electricity prices for specified tariffs at a given location. This endpoint returns a timeseries of price data covering recent hours and upcoming periods, making it ideal for applications needing current pricing information.

Endpoint Overview

GET /live/

This endpoint returns electricity pricing data for specified tariffs, with options to control the level of detail and time resolution.

Data Flow Diagram

Key Parameters

country
string
required

Country code (e.g., DK, SE) for the location.

tariff_id
array
required

Tariff IDs to retrieve prices for. Multiple IDs can be specified by repeating the parameter. Each tariff ID must include the tar_ prefix (e.g., tar_123).

address
string

Location address to determine applicable pricing. Required if coordinates not provided.

latitude
number

Latitude coordinate of the location. Required if address not provided.

longitude
number

Longitude coordinate of the location. Required if address not provided.

time_span
string
default:"60min"

Time resolution of returned prices. Options: 60min, 30min, or 15min.

detail
string
default:"full"

Level of detail in the response:

  • summarized: Only total price
  • semi: Prices aggregated by organization type
  • full: Complete breakdown of all price components
vat
string
default:"excluded"

How to handle VAT in the response:

  • excluded: Prices exclude VAT
  • included: VAT included in each price component
  • separated: VAT shown as separate components

Location Specification

The Calculate endpoint follows the same location specification pattern as other Prezio endpoints:

  1. You must provide either an address or the latitude/longitude coordinates, but not both.
  2. The provided location is used to determine which tariffs are applicable in that geographic area.
  3. For improved accuracy, prefer using an address with postal code when possible.
  4. The endpoint will return a confidence score (1-10) for the location resolution.

Time Range

The Live endpoint returns price data for approximately 3 days:

  • Yesterday (from midnight yesterday in local time)
  • Today
  • Tomorrow (until end of day in local time)

This ensures you have access to recent historical prices and upcoming prices for live energy optimization.

The endpoint will return null values for future time periods if price data is not yet available (e.g. before day ahead spot market prices are published, for spot-based tariffs).

Example Requests

curl -X GET "https://api.prezio.dev/v1/live/?country=DK&tariff_id=tar_123&tariff_id=tar_456&address=Rådhuspladsen 1, Copenhagen&detail=full&time_span=60min"

Response Structure

The response contains a timeseries of pricing data with information about tariff components:

{
  "count": 24,
  "context": {
    "currency": "DKK",
    "unit": "per_kwh",
    "time_span": "60min",
    "location": {
      "input_address": "Rådhuspladsen 1, Copenhagen",
      "coordinates": {
        "latitude": 55.6761,
        "longitude": 12.5683,
        "confidence": 9
      }
    },
    "detail": "full",
    "vat": "excluded"
  },
  "tariff_elements": [
    {
      "element_id": "com_123",
      "element_name": "Grid Usage Fee",
      "tariff_id": "tar_123",
      "tariff_name": "Copenhagen DSO Standard",
      "organization_id": "org_456",
      "organization_name": "Copenhagen Energy Grid",
      "organization_type": "DSO"
    },
    {
      "element_id": "com_789",
      "element_name": "Energy Cost",
      "tariff_id": "tar_456",
      "tariff_name": "Variable Spot Price",
      "organization_id": "org_101",
      "organization_name": "Nordic Power Retail",
      "organization_type": "RET"
    }
  ],
  "results": [
    {
      "datetime": "2023-10-15T14:00:00Z",
      "elements": [
        {
          "id": "com_123",
          "cost": "0.0521"
        },
        {
          "id": "com_789",
          "cost": "0.1045"
        }
      ],
      "interval_cost": "0.1566"
    },
    {
      "datetime": "2023-10-15T15:00:00Z",
      "elements": [
        {
          "id": "com_123",
          "cost": "0.0521"
        },
        {
          "id": "com_789",
          "cost": "0.1195"
        }
      ],
      "interval_cost": "0.1716"
    }
  ]
}

Detail Levels

Full Detail

Returns all price components individually with metadata about each component, ideal for detailed cost analysis.

Semi Detail

Aggregates costs by organization type (DSO, Retailer, etc.), providing simplified but still informative breakdown.

Summarized

Returns only total price for each time interval, useful when only the bottom line matters.

VAT Handling

Control how Value Added Tax is represented in the response:

Best Practices

For most applications, request only the tariffs you need. If you know exactly which tariffs apply to a user, specify those tariff IDs directly rather than retrieving all possible tariffs.

The Live endpoint may return null values for future time periods if price data (especially spot market prices) is not yet available. Handle these cases gracefully in your application.

Use the detail parameter to control response size. If you only need total prices, use detail=summarized to minimize response payload size.

Common Use Cases

Real-Time Pricing Display

Show current and upcoming electricity prices to help users make informed decisions about energy usage.

Smart Device Control

Power automated systems that activate or deactivate devices based on current electricity prices.

Cost Forecasting

Provide users with near-term cost projections for planned energy consumption.

Price Alerts

Notify users when electricity prices fall below or rise above specified thresholds.