🔌 Octopus Energy Free Electricity Events

Real-time API for tracking free electricity events in the UK

API Endpoint

GET https://matthewgall.github.io/octoevents/free_electricity.json

This API provides a comprehensive list of Octopus Energy's free electricity events, automatically updated every hour.

Data Sources

🔗 David S Kendall's API

Historical events from the maintainer of the Home Assistant Octopus Energy integration

oe-api.davidskendall.co.uk/free_electricity.json

🦄 Octopus Energy GraphQL API

Real-time event data fetched directly from Octopus Energy's official GraphQL API

api.octopus.energy/v1/graphql/

Data Format

The API returns a JSON object with a data array containing event objects:

{
  "data": [
    {
      "start": "2024-08-15T12:00:00.000Z",
      "end": "2024-08-15T13:00:00.000Z",
      "code": "1"
    },
    {
      "start": "2024-11-27T11:00:00.000Z",
      "end": "2024-11-27T12:00:00.000Z",
      "code": "9",
      "is_test": true
    }
  ]
}

Fields

How It's Built

Go GitHub Actions GraphQL GitHub Pages YAML Config

Architecture

  1. Data Fetching: Go application authenticates with Octopus Energy API using JWT tokens
  2. Data Merging: Combines historical events from David Kendall's API with new events from Octopus GraphQL
  3. Deduplication: Events are deduplicated using start+end time as unique identifiers
  4. Sequential Coding: Events are assigned sequential integer codes for easy reference
  5. Automated Updates: GitHub Actions runs hourly to fetch and publish new events
  6. GitHub Pages: Data is served via GitHub Pages for high availability

🔄 Update Schedule

This data is automatically updated every hour via GitHub Actions. The service ensures:

Source Code

This service is open source and available on GitHub:

https://github.com/matthewgall/octoevents

Contributing

Issues, feature requests, and pull requests are welcome! The project is designed to be:

Acknowledgments

Special thanks to David S Kendall for maintaining the Home Assistant Octopus Energy integration and providing the original data source that inspired this project.