Access data

Our API allows you to access all the time series data which are available to you on the Nena Portal’s Fundamentals Data page. In addition the API offers several convenience features which does common times series tasks like:

  • Resample the time resolution of the data

  • Filter out specific time periods from a time series

  • Extract specific data such as peak and offpeak from a time series.

Get series metadata

Metadata on time series can be retrieved using either of the two API endpoints shown below. The metadata contains information on the start and end date of the time series as well as describing what kind of data the series contain. It is also possible to see from the metadata when a series was last updated.

Retrieve metadata on a single series

To fetch metadata on a single data series, the following request endpoint is used.

POST /api/fundamental/meta

Get metadata from a single series.

Note: You should replace Username with your Nena username and Token with the access token received by the login request.

Content-Type

application/json

form
{
   "SeriesId": "string",
   "UserInfo": {
      "UserName": "string",
      "Token": "string"
   }
}

Tip

All time series ids can be found on the Nena portal’s fundamentals data page in the information box on the bottom left of the page.

../_images/finding_series_id_on_fundamentals_page_2.png

Example Request

curl --location --request POST 'https://api.nena.no/api/user/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"UserName": "<your-username>",
"Password": "<your-password>"
}'
import requests
import json

url = "https://api.nena.no/api/fundamental/meta"

payload = json.dumps(
   {
      "SeriesId": "NP",
      "UserInfo": {
         "UserName": "<your-username>",
         "Token": "<your-password>"
      }
   }
)

headers = {
'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Example Respons

{
   "startdate": "2012-12-11T00:00:00",
   "enddate": "2022-02-08T23:00:00",
   "Code": "NPsp",
   "Description": "Hourly Day Ahead System Price in Nordics (EUR/MWh)",
   "Unit": "EUR/MWh",
   "Resolution": 0
}

Access time series data

To access actual series data, you use the series API endpoint. The endpoint supports accessing one series at the time. Several convenience keywords are available which lets the API do several common time series processing tasks. This is explained here.

POST /api/fundamental/series

Fetches series data for a single data series.

Form
{
  "FromDateTime": "string",
  "ToDateTime": "string",
  "Resolution": "string",
  "SeriesId": "string",
  "UserInfo": {
      "UserName": "string",
      "Token": "string"
  }
}

Tip

The Resolution, FromDateTime and ToDateTime accepts several convenience keywords. This allows you to extract specific data from a data series such as peak or off-peak data. You can also use keywords such as “week” and “friday” to extract data within a specific time period over a time span. See a list of convenience keywords below.

Example Request

curl --location --request POST 'https://api.nena.no/api/fundamental/series' \
--header 'Content-Type: application/json' \
--data-raw '{
    "FromDateTime": "today+7",
    "ToDateTime": "today-7",
    "Resolution": "hr",
    "SeriesId": "ukhrwind",
    "UserInfo": {
        "UserName": "<you-username>",
        "Token": "<you-access-token>"
        }
}'
import requests
import json

url = "https://api.nena.no/api/fundamental/series"

payload = json.dumps(
    {
        "FromDateTime": "today+7",
        "ToDateTime": "today-7",
        "Resolution": "hr",
        "SeriesId": "ukhrwind",
        "UserInfo": {
            "UserName": "<you-username>",
            "Token": "<you-access-token>"
        }
    }
)

headers = {
'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Example Respone

{
  "LastUpdated": "2022-02-07T10:02:01.143",
  "Meta": {
      "code": "ukhrwind",
      "description": "Hourly Wind in United Kingdom (GWh/h)",
      "unit": "GWh/h",
      "resolution": "Hour",
      "nativeresolution": "Hour",
      "aggregation": "Average"
  },
  "Values": {}
}

Process time series data

As already mentioned the Nena API can return processed time series data. The API support many of the most common time series processing task. Here we will go over some of them.

Re-sampling time series

Many of the times series have an hourly native resolution. To resample a series you provide one of the following keywords to the Resolution parameter in the JSON request body for the /api/fundamental/series endpoint.

Resampling Keywords

Extract specific data from a time series

You can extract specific data from the time series such as peak and offpeak data by providing the following keywords to the Resolution parameter in the JSON request body for the /api/fundamental/series endpoint.

Extraction Keywords

Filtering time series

You can filter time series to only show specific time periods over a time span, or automatically reorient the time series. You do this by providing any of the following keywords to the FromDateTime and ToDateTime parameters in the JSON request body for the /api/fundamental/series endpoint.

Tip

All time keywords support shifting by using integers. For example writing “boy-2” will return the beginning of the year two years ago i.e. 2020-01-01.

DateTime Keywords