GridLeaf API Status

Real-time carbon intensity and energy data API

Checking Status...

Please wait

99.9%

Uptime

30+

Countries

Quick Start

Get started with the GridLeaf API in seconds

1. Test the API (no auth required):

curl https://api-dev.gridleaf.org/countries

2. Get latest energy data:

curl https://api-dev.gridleaf.org/energy-data/Germany/latest?limit=1

3. For full access, register and get an API key:

Authentication Tiers

Public Access

Features:

  • No authentication required
  • Last 72 hours of data only
  • Rate limit: 2 requests/hour, 5/day
  • Max 100 records per request
  • Perfect for testing

Limitations:

  • Limited historical data
  • No forecast access
  • Lower rate limits

JWT Authentication

Features:

  • Full historical data (1 year)
  • Forecast access (24+ hours)
  • Rate limit: 2 requests/hour, 5/day
  • Max 1000 records per request
  • Token expires in 1 hour

Limitations:

  • Short-lived tokens
  • Must refresh regularly

API Key (Recommended)

Features:

  • Same access as JWT
  • Long-lived and revocable
  • Better for automation
  • Client-side friendly
  • Multiple keys per account

Limitations:

  • Requires registration
  • Same rate limits as JWT

Available Endpoints

Get Countries
GET
None

/countries

Returns list of all supported countries

Rate Limit: Public: No limit

Example:

curl https://api-dev.gridleaf.org/countries

Latest Energy Data
GET
Optional

/energy-data/{country}/latest

Get latest N data points for a country

Rate Limit: Public: 2/hour, 5/day

Example:

curl https://api-dev.gridleaf.org/energy-data/Germany/latest?limit=24

Historical/Forecast Data
GET
Required

/energy-data/{country}

Get data for specific time range

Rate Limit: Authenticated: 2/hour, 5/day

Example:

curl -H "X-API-Key: your-key" "https://api-dev.gridleaf.org/energy-data/Germany?start_time=2025-01-01T00:00:00Z&end_time=2025-01-15T23:59:59Z"

User Registration
POST
None

/api/v1/auth/register

Register a new user account

Rate Limit: No limit

Example:

curl -X POST https://api-dev.gridleaf.org/api/v1/auth/register \ -H "Content-Type: application/json" \ -d '{"email":"user@example.com","password":"SecurePass123!","full_name":"John Doe"}'

User Login
POST
None

/api/v1/auth/login

Authenticate and get JWT tokens

Rate Limit: No limit

Example:

curl -X POST https://api-dev.gridleaf.org/api/v1/auth/login \ -H "Content-Type: application/json" \ -d '{"email":"user@example.com","password":"SecurePass123!"}'

Generate API Key
POST
JWT Required

/api/v1/auth/api-keys

Generate a new API key

Rate Limit: No limit

Example:

curl -X POST https://api-dev.gridleaf.org/api/v1/auth/api-keys \ -H "Authorization: Bearer your-jwt-token" \ -H "Content-Type: application/json" \ -d '{"key_name":"My Application"}'

For AI Assistants & Developers

GridLeaf is optimized for AI tool integration

LLM Integration File

Comprehensive documentation for AI tools like ChatGPT, Claude, and Perplexity.

Structured Data

JSON-LD markup helps search engines and AI tools understand our data.

  • Schema.org Dataset markup
  • WebAPI documentation
  • Organization metadata

Use Cases for AI Integration:

For Users:

  • • "What's the carbon intensity in Germany?"
  • • "When should I charge my EV?"
  • • "Which countries have clean grids?"

For Developers:

  • • Smart home automation
  • • Carbon footprint calculators
  • • Energy management systems

GridLeaf Energy Platform • Real-time carbon intensity data for a sustainable future