> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prezio.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# Live Prices

> Get real-time electricity prices for specific tariffs at a location

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

```bash theme={null}
GET /live/
```

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

## Location Specification

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

1. You must provide either a location\_id, a pair of `latitude`/`longitude` coordinates, or an `address`.
2. The provided location is used to determine which tariffs are applicable in that geographic location.
3. For improved accuracy and faster response times, prefer using coordinates over address.

## Time Range

The Live endpoint can return price data for 3 days:

* Yesterday (from midnight yesterday in local time)
* Today (returned by default if no date is provided)
* Tomorrow

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

## Price Precision

All price fields in the response use 6 decimal places (e.g., `"0.123456"`), providing high precision for financial calculations and energy cost analysis.

## Example Requests

<CodeGroup>
  ```bash cURL theme={null}
  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&interval_minutes=60"
  ```

  ```javascript Node.js theme={null}
  const axios = require('axios');

  const response = await axios.get('https://api.prezio.dev/v1/live/', {
    params: {
      country: 'DK',
      tariff_id: ['tar_123', 'tar_456'],
      address: 'Rådhuspladsen 1, Copenhagen',
      detail: 'full',
      interval_minutes: 60
    },
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  });
  ```
</CodeGroup>

## Response Structure

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

<Tabs>
  <Tab title="Full Detail">
    ```json theme={null}
    {
      "count": 24,
      "context": {
        "currency": "DKK",
        "unit": "per_kwh",
        "interval_minutes": 60,
        "timezone": "Europe/Copenhagen",
        "location": {
          "input_address": "Rådhuspladsen 1, Copenhagen",
          "coordinates": {
            "latitude": 55.6761,
            "longitude": 12.5683,
            "confidence": 0.9
          }
        }
      },
      "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": [
        {
          "interval_start": "2023-10-15T14:00:00Z",
          "elements": [
            {
              "id": "com_123",
              "price": "0.052100"
            },
            {
              "id": "com_789",
              "price": "0.104500"
            }
          ],
          "interval_price": "0.156600"
        },
        {
          "interval_start": "2023-10-15T15:00:00Z",
          "elements": [
            {
              "id": "com_123",
              "price": "0.052100"
            },
            {
              "id": "com_789",
              "price": "0.119500"
            }
          ],
          "interval_price": "0.171600"
        }
      ]
    }
    ```
  </Tab>

  <Tab title="Semi Detail">
    ```json theme={null}
    {
      "count": 24,
      "context": {
        "currency": "DKK",
        "unit": "per_kwh",
        "interval_minutes": 60,
        "timezone": "Europe/Copenhagen",
        "location": {
          "input_address": "Rådhuspladsen 1, Copenhagen",
          "coordinates": {
            "latitude": 55.6761,
            "longitude": 12.5683,
            "confidence": 0.9
          }
        }
      },
      "tariff_elements": [
        {
          "element_id": "key_DSO",
          "organization_type": "DSO"
        },
        {
          "element_id": "key_RET",
          "organization_type": "RET"
        }
      ],
      "results": [
        {
          "interval_start": "2023-10-15T14:00:00Z",
          "elements": [
            {
              "id": "key_DSO",
              "price": "0.052100"
            },
            {
              "id": "key_RET",
              "price": "0.104500"
            }
          ],
          "interval_price": "0.156600"
        }
      ]
    }
    ```
  </Tab>

  <Tab title="Summarized">
    ```json theme={null}
    {
      "count": 24,
      "context": {
        "currency": "DKK",
        "unit": "per_kwh",
        "interval_minutes": 60,
        "timezone": "Europe/Copenhagen",
        "location": {
          "input_address": "Rådhuspladsen 1, Copenhagen",
          "coordinates": {
            "latitude": 55.6761,
            "longitude": 12.5683,
            "confidence": 0.9
          }
        }
      },
      "results": [
        {
          "interval_start": "2023-10-15T14:00:00Z",
          "interval_price": "0.156600"
        },
        {
          "interval_start": "2023-10-15T15:00:00Z",
          "interval_price": "0.171600"
        }
      ]
    }
    ```
  </Tab>
</Tabs>

## Detail Levels

<CardGroup cols={3}>
  <Card title="Full Detail" icon="list-check" color="#83b5ab">
    Returns all price components individually with metadata about each component, ideal for detailed cost analysis.
  </Card>

  <Card title="Semi Detail" icon="layer-group" color="#3f8376">
    Aggregates costs by organization type (DSO, Retailer, etc.), providing simplified but still informative breakdown.
  </Card>

  <Card title="Summarized" icon="calculator" color="#c7beff">
    Returns only total price for each time interval, useful when only the bottom line matters.
  </Card>
</CardGroup>

<Check>
  If you only need total prices, use `detail=summarized` to minimize response payload size and get a faster response.
</Check>

## VAT Handling

Control how Value Added Tax is represented in the response:

<AccordionGroup>
  <Accordion title="VAT Excluded" icon="circle-minus">
    All prices exclude VAT (default behavior).
  </Accordion>

  <Accordion title="VAT Included" icon="circle-plus">
    Each price component includes its applicable VAT.
  </Accordion>

  <Accordion title="VAT Separated" icon="layer-group">
    VAT is shown as separate component(s).
  </Accordion>
</AccordionGroup>

## Missing spot market prices

<Warning>
  The Live endpoint may return price values of zero when missing spot prices, e.g. when market prices are not yet available. In those cases, the endpoint will return a warning in the metadata `warnings` field.
</Warning>

## Common Use Cases

<CardGroup cols={2}>
  <Card title="Real-Time Pricing Display" icon="gauge-high" color="#83b5ab">
    Show current and upcoming electricity prices to help users make informed decisions about energy usage.
  </Card>

  <Card title="Smart Device Control" icon="bolt" color="#3f8376">
    Power automated systems that activate or deactivate devices based on current electricity prices.
  </Card>

  <Card title="Cost Forecasting" icon="chart-line" color="#c7beff">
    Provide users with near-term cost projections for planned energy consumption.
  </Card>

  <Card title="Price Alerts" icon="bell" color="#ffb07c">
    Notify users when electricity prices fall below or rise above specified thresholds.
  </Card>
</CardGroup>
