PeakShiftPeakShiftPeakShiftAPI Referencev1
Get sandbox accessSandbox
Download OpenAPI

Getting Started

  • Introduction
  • Quick Start
  • Authentication
  • Code Examples
  • Sandbox

Reference

  • Rate Limits
  • Error Codes
  • Changelog
  • API Reference

Resources

  • OpenAPI spec (YAML)
  • Support
REST API · v1 · Green Button Connect My Data

PeakShift API Reference

Consented access to residential electricity interval data from Ontario utilities, delivered through Green Button Connect My Data and normalized to one JSON model. JSON over HTTPS with Bearer API keys. Build and test against the sandbox today; live access is enabled per partner.

Get sandbox access Quick start
Base URL
www.peakshift.ca/api
Auth
Bearer API key
Format
JSON (CSV export)
Data
Hourly electricity
18 live utilities · Milton Hydro in testing4.9M+ Ontario customers · electricity only
Toronto Hydro
Hydro One
Alectra
Hydro Ottawa
Elexicon
London Hydro
ENWIN
Oakville Hydro
Burlington Hydro
Oshawa Power
Newmarket-Tay
Festival Hydro
NPEI
ELK Energy
Enova Power
GrandBridge
Entegrus
Greater Sudbury
Milton Hydro (testing)

Quick Start (sandbox)

With a sandbox key (pk_sandbox_…) you can run the whole flow end to end in a few minutes. Set PEAKSHIFT_KEY to your key first.

  1. 1

    List supported utilities

    18 live Ontario utilities plus Milton Hydro (testing).

    curl -s https://www.peakshift.ca/api/v1/utilities \
      -H "Authorization: Bearer $PEAKSHIFT_KEY"
  2. 2

    Look up the utility for an address

    By postal code (or FSA) or city. The response includes match_type and confidence.

    curl -s "https://www.peakshift.ca/api/v1/utilities/lookup?postal_code=M5V2T6" \
      -H "Authorization: Bearer $PEAKSHIFT_KEY"
  3. 3

    Start consent

    account_id is a UUID your app generates for the customer. state is optional and returned unchanged.

    curl -s -X POST https://www.peakshift.ca/api/v1/auth/consent/initiate \
      -H "Authorization: Bearer $PEAKSHIFT_KEY" \
      -H "Content-Type: application/json" \
      -d '{"account_id":"3f6c1b9e-2d4a-4c8e-9b1f-7a2e5d8c0f41",
           "utility":"toronto_hydro",
           "redirect_uri":"https://yourapp.example/peakshift/callback",
           "state":"xyz123"}'
  4. 4

    Open authorization_url and approve

    In sandbox this is a clearly labelled simulated authorization page. After approval the browser is redirected to your redirect_uri.

    https://yourapp.example/peakshift/callback
      ?consent_session_id=9b2d7c4e-...&account_id=3f6c1b9e-...
      &state=xyz123&status=authorized&utility=toronto_hydro
  5. 5

    Fetch account metadata

    Utility, service points, data range and (sandbox) a simulated service address.

    curl -s https://www.peakshift.ca/api/v1/accounts/3f6c1b9e-2d4a-4c8e-9b1f-7a2e5d8c0f41/metadata \
      -H "Authorization: Bearer $PEAKSHIFT_KEY"
  6. 6

    Fetch the energy profile

    12 months of hourly usage plus a summary. Use granularity=daily|monthly, start/end (YYYY-MM-DD) and format=csv as needed.

    curl -s "https://www.peakshift.ca/api/v1/accounts/3f6c1b9e-2d4a-4c8e-9b1f-7a2e5d8c0f41/energy-profile?granularity=monthly" \
      -H "Authorization: Bearer $PEAKSHIFT_KEY"

Authentication

Every endpoint requires your API key in the Authorization header. Keys are issued by PeakShift — email [email protected]. The environment is a property of the key; the base URL is the same.

Authorization: Bearer pk_sandbox_your_key_here
Sandbox key
pk_sandbox_…

Simulated consent flow and deterministic synthetic data for every utility in the catalog. No real customer data.

Live key
pk_live_…

Real Green Button data for accounts your key connects. Live consent is enabled per partner on request.

Key security: keep API keys server-side — never in browser or mobile app code or public repositories. If a key may be exposed, email [email protected] and we will revoke and reissue it.

Code Examples

Fetching daily usage for January for a connected account.

curl -s "https://www.peakshift.ca/api/v1/accounts/{account_id}/energy-profile?granularity=daily&start=2026-01-01&end=2026-01-31" \
  -H "Authorization: Bearer pk_sandbox_your_key_here"

Replace account_id with the UUID you used when starting consent.

Sandbox

The sandbox lets you build the full integration — coverage lookup, consent redirect handling and data parsing — without real customer data.

How it works

  • Same base URL and endpoints as live; a pk_sandbox_ key selects the sandbox
  • POST /v1/auth/consent/initiate returns a simulated authorization page with Approve / Deny
  • Approval redirects to your redirect_uri exactly as a live consent will
  • Any utility in GET /v1/utilities works, including Milton Hydro (testing)

Synthetic data

  • Deterministic per account_id + utility: same input, same data
  • Last 12 full months, hourly, America/Toronto local time
  • Household archetypes (gas, electric or heat-pump heating; EV; central AC) with regional climate
  • Responses include "simulated": true and a sandbox_household description

Rate Limits

Limits apply per API key, per minute (sandbox keys default to 60 requests/minute; higher limits on request). Responses include X-RateLimit-Limit and X-RateLimit-Remaining. When exceeded the API returns 429 rate_limit_exceeded with Retry-After: 60.

Error Codes

All errors return {"error": {"code": "…", "message": "…"}}. Handle errors by code; messages may change.

HTTPCodeMeaningHandling
400invalid_requestRequest body is not a JSON object.Send a JSON object with Content-Type: application/json.
400invalid_parameterA parameter is missing or invalid. The message names the parameter.Fix the request; do not retry unchanged.
400validation_errorWebhook registration input is invalid (URL or event names).Use a public https URL and supported event names.
401unauthorizedAPI key missing, invalid, inactive or expired.Send Authorization: Bearer <key>. Contact us if your key expired.
404account_not_foundThe account does not exist or was not connected by your API key.Use the account_id from a completed consent made with the same key.
404not_coveredNo covered utility for the location, or the location is outside Ontario.Show the customer an out-of-coverage message.
409account_conflictThe account_id is already used by another API key.Generate a new UUID for the customer.
429rate_limit_exceededPer-key request limit exceeded.Wait for Retry-After seconds (60), then retry.
500server_errorUnexpected server error.Retry with exponential backoff; contact us if it persists.
503live_consent_unavailableLive consent has not been enabled for your live key yet.Email [email protected] to enable live onboarding.

Changelog

October 2026
v1 — Phase 1October 2026
  • Developer sandbox: simulated consent flow and deterministic synthetic data for all 19 utilities
  • GET /v1/utilities and GET /v1/utilities/lookup (postal code / city coverage lookup)
  • Per-partner account isolation: every account belongs to the API key that connected it
  • Energy profile: granularity (hourly / daily / monthly), start / end date window, CSV export
August 2026
CoverageAugust 2026
  • 18 Ontario utilities live via Green Button Connect My Data; Milton Hydro in testing

Interactive API Reference

Download YAML

Click Authorize and paste a sandbox key to try requests from this page.

Loading API Specification...