Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

NetAnders API Manual

The NetAnders API provides insight into the current and historical sustainable energy generation in the Netherlands.

What is an API?

An API (Application Programming Interface) is a software interface through which two applications can easily communicate with each other. By submitting a request with certain parameters such as the sustainable source and date, the NetAnders API returns the requested energy data.

What can you do with the NetAnders API?

If you have the right authorisation, with the NetAnders API you gain insight into:

  • The near real-time renewable energy production in the Netherlands

  • The sustainable production in capacity (kW) and in volume (kWh)

  • The utilization rates of sustainable energy sources expressed in percentages compared to the installed capacity

  • The various sustainable energy sources. Get insight to all of them of just a selection. We provide insights into the following sources: solar, onshore wind, offshore wind, biogas, heat pumps, geothermal energy, adding and co-firing of biomass in coal-fired power stations, biomass boilers companies, wood stoves at home, waste plants and bio-oil.

  • The historical sustainable production from 2016, the non-sustainable electricity production from 2021

  • 10 minutes, 15 minutes, hour, day, month and year values

  • The total electricity production generated by various sources for the Netherlands

  • The gas consumption for the Netherlands, excluding feedstock and powerplant usage

  • ….

What type of API is it?

The NetAnders API is a RESTful Open Api. The following file formats are available: jsonld, jsonhal, jsonapi, json, xml, csv and html.

Access to the API - API Key

NetAnders provides an API Key. This unique key gives access to requesting energy data from the NetAnders API. The API key must be sent with every request. Do not give the key to others.

API specifications

For the developers, the detailed specifications of the API can be found in Swagger UI or Redoc via the following links:

• Swagger UI: https://api.netanders.io/v1

• Redoc: https://api.netanders.io/v1?ui=re_doc

Submitting a request

When submitting a request, a number of parameters must be included. The table below shows and describes the available parameter values. You can enter an individual value or a collection of values ​​that refer to a series of individual values.

Example for a request

Suppose you want to receive the Dutch solar data in 10 minutes values on November 16, 2020 in json. To do this, include the following parameters in the request. Below we also highlight a request in cURL, PHP-cURL and Python.

The header

Accept: application/ld+json: json – file format.

X-AUTH-TOKEN: YourSuperSecretApiKey – API Key

Main message

Point: 0 - Netherlands

Type: 2 - Solar

Granularity 3 - 10 min

Timezone 1 - UTC

Classification 2 – current

Activity 1 - providing

Validfromstrictlybefore 2020-11-16

Validfromafter 2020-11-17

cURL

curl --location -g --request GET 'https://api.netanders.io/v1/utilizations?point=0&type=2&granularity=3&granularitytimezone=1&classification=2&activity=10&validfrom[strictly_before]=2020-11-17&validfrom[after]=2020-11-16' \

--header 'X-AUTH-TOKEN: YourSuperSecretApiKey ' \

--header 'accept: application/ld+json '

PHP- cURL

<?php

$curl = curl_init();

curl_setopt_array($curl, array(

CURLOPT_URL => 'https://api.netanders.io/v1/utilizations?point=0&type=2&granularity=3&granularitytimezone=1&classification=2&activity=10&validfrom%5Bstrictly_before%5D=2020-11-17&validfrom%5Bafter%5D=2020-11-16',

CURLOPT_RETURNTRANSFER => true,

CURLOPT_ENCODING => '',

CURLOPT_MAXREDIRS => 10,

CURLOPT_TIMEOUT => 0,

CURLOPT_FOLLOWLOCATION => true,

CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,

CURLOPT_CUSTOMREQUEST => 'GET',

CURLOPT_HTTPHEADER => array(

'X-AUTH-TOKEN: YourSuperSecretApiKey ', ),

));

$response = curl_exec($curl);

curl_close($curl);

echo $response;

Python

import requests

url = "https://api.netanders.io/v1/utilizations?point=0&type=2&granularity=3&granularitytimezone=1&classification=2&activity=10&validfrom[strictly_before]=2020-11-17&validfrom[after]=2020-11-16"

payload={}

headers = {

'X-AUTH-TOKEN': ' YourSuperSecretApiKey ',

'accept: application/ld+json '}

response = requests.request("GET", url, headers=headers, data=payload, allow_redirects=False)

print(response.text)

Visualisation snippet

To get an idea of ​​the energy data that is requested, we provide a snippet with which the data can be visualized. The snippet is easy to use in for example Postman, among others. The snippet can be found via this link: https://bitbucket.org/netanders/workspace/snippets/RLpGgL/postman-test-and-visualize

Response to the request

After the request, a result will be returned in the desired file format. The following data is returned:

• Capacity - the average capacity over the selected granularity in kW

• Volume - the production volume in kWh

• Percentage - the utilization rate as a percentage of the total capacity at that moment

• Emission – the emission of CO2 in kg
• Emissionfactor – the emission factor used for this source in kg/kWh, if no value is provided the emission is zero (0)

Tip: for a visualization of the generation it is easiest to use the capacity.

Below the data that is returned by the API. This is a record from the example mentioned.

"@id": "/v1/utilizations/3844522221",

"@type": "Utilization",

"type": "/v1/types/2",
"granularity": "/v1/granularities/3",

"granularitytimezone": "/v1/granularity_time_zones/0",

"id": 3844522221,

"point": "/v1/points/0",

"activity": "/v1/activities/1",

"classification": "/v1/classifications/2",

"capacity": 438626,

"volume": 73104,

"emission":,

"emissionfactor":,

"percentage": 0.05968400090932846,

"validfrom": "2020-11-16T14:30:00+00:00",

"validto": "2020-11-16T14:40:00+00:00",

"lastupdate": "2020-11-19T14:06:04+00:00"

Parameter table

Parameter

Description

Values

Activity

Gives the activity type of the energy record.

1 Providing
2 Consuming

Authorisation

Gives the Authorisations for users.

True

Classification

Gives the Classification type of the energy record. (Ex. Near-realtime or Forecast)

1 Backcast

2 Current

3 forecast

Granularity

Every Utilization data record is a grouped by a granularity. This table has the Granularity names.

3 10 minutes

4 15 minutes

5 hour

6 day

7 Month

8 Year

GranularityTimeZone

Every Granulairty is valid for a certain timezone, this data record holds the name of this timezone.

1 UTC

2 Europe/Amsterdam

Point

Gives the Point of the energy record.

0 Nederland

1 Groningen

2 Friesland

3 Drenthe

4 Overijssel

5 Flevoland

6 Gelderland

7 Utrecht

8 Noord-Holland

9 Zuid-Holland

10 Zeeland

11 Noord-Brabant

12 Limburg

14 Offshore

Type

Gives the Type of the energy resource.

0

All

1

Wind

2

Solar

3

Biogas

4

HeatPump

8

Cofiring

9

Geothermal

10

Other

11

Waste

12

BioOil

13

Biomass

14

Wood

17

WindOffshore

18

FossilGasPower

19

FossilHardCoal

20

Nuclear

21

WastePower

22

WindOffshoreB

23

NaturalGas

24

Biomethane

25

BiomassPower

26

OtherPower

27

ElectricityMix

28

GasMix

35

WKK Total

Historical data updates

Sometimes historical data provided by the API gets updated. Several triggers exist, which include

  1. changes in the source data

  2. changes in model parameters

  3. changes in the model itself

Whenever a trigger has occurred the ‘lastupdate’ field is modified (note that this does not necessarily mean the interval value itself has changed). Some triggers are periodic (i.e. data gets recomputed daily) and others are manual (recomputation gets done by NetAnders’s request).

Any questions, just let us know!

info@netanders.nl

1

I

  • No labels