wattlayer
v1.0.0
Published
Official JavaScript/TypeScript SDK for WattLayer — Korea's power-market & distributed-energy data API.
Maintainers
Readme
WattLayer JavaScript/TypeScript SDK
Korea's power-market & distributed-energy data, one import away.
npm install wattlayerimport { WattLayerClient } from 'wattlayer';
const wl = new WattLayerClient({ apiKey: 'wl_live_...' }); // or WATTLAYER_API_KEY env
const smp = await wl.smp.latest({ country: 'kr', region: 'mainland' });
console.log(`${smp.price} KRW/kWh`);
const supply = await wl.supply.current({ country: 'kr' });
const jeju = await wl.zones.get('kr-jeju');
// Intelligence
const card = await wl.regions.scorecard({ loadType: 'datacenter' });
const site = await wl.siting.score({ region: 'jeonnam', capacityMw: 100, loadType: 'datacenter' });Get a free key (10,000 calls/month, no card) at https://console.wattlayer.io/register.
Resources
smp · supply · weather · facilities · zones · events · auth · meta ·
regions (scorecard, gridCapacity, availableCapacity, tariffs) · siting (score)
Requests retry automatically (1s/2s/4s) on 429/5xx. Errors derive from WattLayerError
(WattLayerAuthError, WattLayerNotFoundError, WattLayerRateLimitError, …).
Works in Node 18+ (native fetch) and modern browsers.
License
MIT · Data under KOGL Type 1 (attribution) from KPX, KEPCO & KMA via data.go.kr.
