# Nationaal Energie Dashboard

**URL:** <https://community.homey.app/t/nationaal-energie-dashboard/126609>\
**Category:** Ideeën & Suggesties\
**Created:** [January 5, 2025, 10:46am UTC](https://community.homey.app/t/nationaal-energie-dashboard/126609 "2025-01-05T10:46:14Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [May 17, 2025, 9:09pm UTC](https://community.homey.app/t/nationaal-energie-dashboard/126609/5 "2025-05-17T21:09:24Z")

</div>

Hoi Mark, Johan,

Na het ‘tegenkomen’ van ned.nl vond ik dit topic.

Nu heb ik het voor elkaar gekregen om gegevens zoals ‘type’ e.d. op te vragen via de [API handleiding](https://ned.nl/nl/handleiding-api).

Dit scriptje hieronder zou hetzelfde moeten doen uit dat API voorbeeld, maar ja maar ja…  
Ik ben dus erg benieuwd hoe je bijv. de zonverwachting opvraagt.

```auto
// API page: https://api.ned.nl/v1#/
// https://ned.nl/datacatalogus
// https://ned.nl/nl/handleiding-api

const myAPIKey = 'abc123'; // change into personal API key here

// get date in yyyy-mm-dd format //
const dateIso = new Date().toISOString.substring(0,10);

const dateStart = '2025-05-16'; // enter start date (todo: coded date)
const dateEnd = dateIso; // today's date
const baseURL = 'https://api.ned.nl/v1';

//// Parameters to send along with the request ////
//// Point: 0 - Netherlands
//// Type: 2 - Solar
//// Granularity 3 = 10 min 
//// Timezone 1 = EU/AMS 
//// Classification 2 = current 
//// Activity 1 = providing 
//// Validfromstrictlybefore = yyyy-mm-dd 
//// Validfromafter = yyyy-mm-dd 

//// Test getting some values:
////const URL = baseURL + `\types?page=1&itemsPerPage=30`;

const URL = baseURL + `utilizations?point=0&type=2&granularity=3&granularitytimezone=1&classification=2&activity=1&validfrom[strictly_before]=${dateEnd}&validfrom[after]=${dateStart}`;

const res = await fetch(URL, {
              headers : {
              "X-AUTH-TOKEN": myAPIKey,
              accept: "application/ld+json" 
              }
            });
            if (!res.ok) {
              throw new Error(res.status + '\n' + res.json); // 401 = unauthorised, 404 = not found
              return false;
            }

const json = await res.json();
//const value = json.value;
log (json);
return true;

```

---

_[View the full topic](https://community.homey.app/t/nationaal-energie-dashboard/126609)._
