API Documentation

Everything you need to integrate WattMarkets real-time energy data into your applications.

Getting Started

Authentication

All API requests require authentication using a Bearer token in the Authorization header.

Authorization: Bearer wm_your_api_key_here

Base URL

All API endpoints are relative to this base URL.

https://api.wattmarkets.com

Code Examples

cURL

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.wattmarkets.com/v1/lmp/north

JavaScript/TypeScript

import { WattMarkets } from '@wattmarkets/sdk';

const wm = new WattMarkets('YOUR_API_KEY');
const lmp = await wm.lmp.get('north');
console.log(`North Hub: $${lmp.price}/MWh`);

Python

from wattmarkets import WattMarkets

wm = WattMarkets('YOUR_API_KEY')
lmp = wm.lmp.get('north')
print(f"North Hub: ${lmp['price']}/MWh")

API Endpoints

Market Data

GET/v1/lmp/{hub}

Get real-time LMP data for a specific hub

GET/v1/ordc

Get current ORDC adder values

GET/v1/4cp

Get 4CP probability predictions

Alerts

GET/v1/alerts

List all your alerts

POST/v1/alerts

Create a new alert

Custom Metrics

GET/v1/metrics

List all your custom metrics

POST/v1/metrics

Create a new custom metric

Response Format

Success Response

{
  "success": true,
  "data": {
    "hub": "north",
    "price": 47.23,
    "timestamp": "2024-01-30T15:30:00Z",
    "unit": "$/MWh"
  }
}

Error Response

{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "API rate limit exceeded",
    "details": {
      "limit": 100,
      "reset_at": "2024-01-30T16:00:00Z"
    }
  }
}

Ready to get started?

Get your API key and start building with real-time energy data.