Programmatic access to normalized Green Button energy consumption data from Ontario's five utilities. REST API, JSON responses, Bearer token auth, <400ms p99 response time, 99.5% uptime SLA.
Sign up at peakshift.ca/signup → verify your email → API keys are available immediately in your dashboard. Sandbox keys are available instantly with no approval required. Production keys require a one-time verification form.
All API endpoints require a Bearer token in the Authorization header.
Authorization: Bearer pk_live_your_key_hereUse the code examples below, or scroll to the API Reference and click Try it out on any endpoint.
pk_test_...Use for development and testing. Returns mock utility data. No approval required.
pk_live_...Returns real Ontario utility data. Requires one-time verification form after signup.
Key security: Never expose API keys in client-side code or public repositories. Use environment variables. Rotate immediately from the dashboard if a key is compromised. Contact parth.patel@peakshift.ca if you suspect a key breach.
Fetching 12 months of usage data for a connected homeowner account.
curl -X GET "https://api.peakshift.ca/v1/accounts/{account_id}/usage" \
-H "Authorization: Bearer pk_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"start_date": "2025-01-01",
"end_date": "2025-12-31",
"interval": "monthly"
}'Replace account_id with an ID from GET /accounts.
Rate limits apply per API key. When exceeded, the API returns 429 Too Many Requests with a Retry-After: {seconds} header. Implement exponential backoff starting at the Retry-After value.
| Endpoint | Req/min | Daily cap | Burst | Plan |
|---|---|---|---|---|
| GET /accounts/{id}/usage | 60 | 5,000 | 10/s | All |
| GET /accounts | 120 | 10,000 | 20/s | All |
| POST /accounts/{id}/authorize | 10 | 500 | 2/s | All |
| GET /accounts/{id}/intervals | 60 | 5,000 | 10/s | Pro+ |
| POST /webhooks | 30 | 2,000 | 5/s | Pro+ |
| GET /utilities | 300 | Unlimited | 50/s | All |
Pro+ plan includes higher limits. Contact us for enterprise volume pricing.
All errors return JSON with error (machine code) and message (human description) fields. Application-level errors use error_code for programmatic handling.
invalid_requestMissing or malformed request body, invalid date range, or unsupported interval value.
Validate request parameters before sending. Check required fields in the API reference.
invalid_api_keyAPI key missing, malformed, or revoked. Key prefix must be pk_live_ (production) or pk_test_ (sandbox).
Verify the Authorization header format: Bearer pk_live_xxx. Rotate key from dashboard if compromised.
token_expiredOAuth token for a homeowner account has expired or been revoked by the homeowner.
Re-initiate the OAuth flow for this account. The homeowner must re-authorize access.
insufficient_scopeAPI key does not have permission for this endpoint. Sandbox keys cannot access production endpoints.
Upgrade to a plan that includes this endpoint, or use a production key for live data.
account_not_foundAccount ID does not exist or belongs to a different API key.
Verify the account_id from the accounts list endpoint. IDs are not portable across environments.
rate_limit_exceededYou have exceeded the rate limit for this endpoint. See Retry-After header for wait time in seconds.
Implement exponential backoff. Read Retry-After header. Consider upgrading plan for higher limits.
utility_unavailablePeakShift infrastructure is operational but the specific utility API is temporarily unreachable.
Retry after 60s. Check status.peakshift.ca for utility-specific outage information.
service_unavailablePeakShift API infrastructure is temporarily unavailable. Rare — target uptime is 99.5%.
Retry with exponential backoff starting at 5s. Subscribe to status page for incident updates.
The sandbox environment lets you build and test integrations without real Ontario homeowner data. Sandbox keys are available immediately on account creation — no approval required.
https://api.peakshift.ca/v1 (with pk_test_ key)Breaking changes are communicated with 30 days advance notice via email and this changelog. Subscribe to status.peakshift.ca for incident updates.