API-Referenz

Leneda provides REST APIs through which you can retrieve data related to the energy market in Luxembourg. The authentication to the API endpoints is done through API keys which can be generated/regenerated by each user by themselves. The authorization that determines which data you are allowed to retrieve through an API endpoint is handled by a so called "Energy ID" which must be provided in the request headers of a request. Leneda`s API expects the content type of API requests to be application/json.

Credentials

All requests to Lenedas’s REST API need to be authenticated. Therefore a valid API Key and an Energy Id in the X-API-KEY and X-ENERGY-ID request headers are required.

A tutorial which describes how you can create an API key you can find here.

Example cURL:

curl -X GET "https://api.leneda.eu/api/endpoint" \
  -H "X-API-KEY: <your-api-key>" \
  -H "X-ENERGY-ID: <your-energy-id>"

API Endpoints

Get metering data

Summary

Retrieves metering data for a specific metering point and OBIS code within a user-defined time range.

HTTP Method

GET

URL

/api/metering-points/{meteringPointCode}/time-series

Query Parameters

ParameterTypeRequiredDescription
startDateTimestringYesThe start of the time range in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ).
endDateTimestringYesThe end of the time range in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ).
obisCodestringYesThe OBIS code specifying which metering data you want to retrieve.

Path Parameters

ParameterTypeDescription
meteringPointCodestringThe code of your metering point.

Example Request

curl -X GET "https://api.leneda.eu/api/metering-points/LU-METERING_POINT1/time-series?startDateTime=2024-01-01T01%3A00%3A00Z&endDateTime=2024-01-10T01%3A00%3A00Z&obisCode=1-1%3A2.29.0" \
  -H "X-API-KEY: <your-api-key>" \
  -H "X-ENERGY-ID: <your-energy-id>"

Example Response

200 OK

{
  "meteringPointCode": "YOUR_METERING_POINT_CODE",
  "obisCode": "1-1:2.29.0",
  "intervalLength": "PT15M",
  "unit": "kW",
  "items": [
    {
      "value": 14.588,
      "startedAt": "2024-07-01T01:00:00Z",
      "type": "Actual",
      "version": 1,
      "calculated": false
    },
    {
      "value": 22.214,
      "startedAt": "2024-07-01T01:15:00Z",
      "type": "Actual",
      "version": 1,
      "calculated": false
    },
    {
      "value": 8.827,
      "startedAt": "2024-07-01T01:30:00Z",
      "type": "Actual",
      "version": 1,
      "calculated": false
    }
  ]
}

Notes

  • The query parameters must be URL-encoded.
  • OBIS Code Reference: If you’re unsure which OBIS code corresponds to the desired metering data, please consult the documentation available here.
  • You can find an example implementation demonstrating how to use this endpoint in the following GitHub repository (currently in progress).

Get aggregated metering data

Summary

Retrieves aggregated metering data for a specific metering point and OBIS code within a user-defined date range. For obis codes that store values in kW the aggregation is done by summing up the values in kW and returning a result in kWh.

HTTP Method

GET

URL

/api/metering-points/{meteringPointCode}/time-series/aggregated

Query Parameters

ParameterTypeRequiredDescription
startDatestringYesThe start of the date range in ISO 8601 format (YYYY-MM-DD).
endDatestringYesThe end of the date range in ISO 8601 format (YYYY-MM-DD).
obisCodestringYesThe OBIS code specifying which metering data you want to retrieve.
aggregationLevelstringYesThe aggregation level used for the aggregation. The possibilities are: Hour, Day, Week, Month, or Infinite. If Infinite is selected the Leneda API will return you one aggregated value for the complete date range.
transformationModestringYesThe transformation mode used for the aggregation. The offered possibility is: Accumulation.

Path Parameters

ParameterTypeDescription
meteringPointCodestringThe code of your metering point.

Example Request

This request will fetch you one aggregated value for the total consumption of January 2025.

curl -X GET "https://api.leneda.eu/api/metering-points/YOUR_METERING_POINT_CODE/time-series/aggregated?obisCode=1-1%3A1.29.0&startDate=2025-01-01&endDate=2025-01-31&aggregationLevel=Infinite&transformationMode=Accumulation" \
  -H "X-API-KEY: <your-api-key>" \
  -H "X-ENERGY-ID: <your-energy-id>"

Example Response

200 OK

{
  "aggregatedTimeSeries": [
    {
      "value": 3744.0485,
      "startedAt": "2025-01-01T23:00:00Z",
      "endedAt": "2025-01-31T23:00:00Z",
      "calculated": false
    }
  ],
  "unit": "kWh"
}

Notes

  • The query parameters must be URL-encoded.
  • OBIS Code Reference: If you’re unsure which OBIS code corresponds to the desired metering data, please consult the documentation available here.

Create metering data access request

Summary

Creates a metering data access request for a list of metering points and a list obis codes from another person or company.

HTTP Method

POST

URL

/api/metering-data-access-request

Request Body

FieldTypeRequiredDescription
fromstringYesEnergy id of the person or company supposed to receive the metering data access request.
fromNamestringYesThe exact name of the person or company supposed to receive the metering data access request. Note: The name has to be written the same way as in Leneda.
meteringPointCodesarray[string]YesA list of metering point codes for which you want to request access.
obisCodesarray[string]YesA list of obis codes for which you want to request access.

Example request body

{
  "from": "ReceiverEnergyId",
  "fromName": "ReceiverName",
  "meteringPointCodes": ["meteringPoint1", "meteringPoint2", "meteringPoint3"],
  "obisCodes": ["obisCode1", "obisCode2"]
}

Example Request

curl -X POST "https://api.leneda.eu/api/metering-data-access-request" \
  -H "accept: */*" \
  -H "X-Energy-Id: your-energy-key" \
  -H "X-API-KEY: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "LUXE-MA-MU-ABCD5",
    "fromName": "Max Musterman",
    "meteringPointCodes": [
      "LU-METERING_POINT1",
      "LU-METERING_POINT2",
      "LU-METERING_POINT3",
      "LU-METERING_POINT4"
    ],
    "obisCodes": [
      "1-1:1.29.0",
      "1-1:3.29.0"
    ]
  }'

Notes

  • OBIS Code Reference: If you’re unsure which OBIS code corresponds to the desired metering data, please consult the documentation available here.