This article will provide a brief overview of how to use our API to submit meter data to Energinet.
Our API
Our API is a REST API, which adheres to the RESTful architectural style. You should be able to find the information you need below to get started quickly.
Limitations in the API:
-
Each sender profile is allowed to make one request every 10 minutes.
-
The maximum size of a data payload is 0.5 MB.
-
Maximum 50 individual sender profiles per import.
- Timestamp must not be older than five years
Sending Data to Energinet
Pushing data to our platform using our API is a simple process. The following steps will guide you through the process:
To be able to create an API token, you need to be a system admin for the whole top level to which you are adding the import.
-
Create a new API import in Energinet (In the settings menu). Selecting what part of the tree structure the import should be valid for is essential.
-
Add a Sender in Energinet. You will then be able to access the API token for that sender. You can have up to 50 individual senders in one import.
-
Submit data in JSON format(see example below); you must make authorized calls to Energinet's API. Authorization is done with bearer tokens. Such a token (loose code) is placed in the authorization header of the http call to the API as follows:Authorization: Bearer [token]
-
[token] should be replaced with your token from Energinet
-
The API has one endpoint for submitting meter data:https://www.energinet.net/apiImport/data
-
The data is designed as a list of metrics/value sets and associated values. Each meter/value set must have a meterID defined as an import identifier in the meter setup in Energinet. There must also be a dateTime that follows ISO8106. The value field can only be a floating-point number.
Example of data submission:
URL: https://www.energinet.net/apiImport/data
Method: POST
Headers:
Authorization: Bearer [token]
Content-Type: application/json
Accept: application/json
Example payload:
[
{
"meterID": "7777777777",
"values": [[
"2023-02-02T01:00",
45
],[
"2023-02-02T02:00",
46
]]
},
{
"meterID": "6666666666",
"values": [[
"2023-02-02T01:00",
34
],[
"2023-02-02T02:00",
23.44
]]
}
]
Example response:
Headers:
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"meterID": "7777777777",
"number_of_values": 2,
"status": 201
},
{
"meterID": "6666666666",
"number_of_values": 2,
"status": 201
}
]