> ## Documentation Index
> Fetch the complete documentation index at: https://docs.powersignals.co.za/llms.txt
> Use this file to discover all available pages before exploring further.

# System State

> Returns South African grid system state data for the given time range. Supports hourly (1h) and daily (1d) intervals. Requires API key authentication.

## Overview

Returns South African grid system state data for a given time range. This covers residual demand, imports/exports, total renewable generation, and derived grid metrics (renewable share, OCGT ramp, forecast error). For the per-fuel-type generation breakdown, see [Generation Mix](/api-reference/generation/mix).

### Use Cases

* Monitor the current state of the South African power grid
* Track renewable energy penetration over time
* Detect OCGT ramp events (indicators of grid stress)
* Build energy forecasting models with historical data

### Intervals

| Interval | Description                                   |
| -------- | --------------------------------------------- |
| `1h`     | Raw hourly readings from Eskom                |
| `1d`     | Daily aggregation (averages, max ramp events) |

### Data Fields (Hourly)

Each record in the `data` array contains:

| Field                  | Unit     | Description                           |
| ---------------------- | -------- | ------------------------------------- |
| `ts`                   | ISO-8601 | Timestamp (UTC)                       |
| `residual_demand_mw`   | MW       | System demand minus RE generation     |
| `residual_forecast_mw` | MW       | Forecasted residual demand            |
| `total_re_mw`          | MW       | Total renewable generation            |
| `imports_mw`           | MW       | Power imports                         |
| `exports_mw`           | MW       | Power exports                         |
| `net_import_mw`        | MW       | Imports minus exports                 |
| `renewable_share_pct`  | %        | Renewable % of total generation       |
| `ocgt_ramp_mw`         | MW       | Hour-over-hour OCGT change            |
| `forecast_error_mw`    | MW       | Actual minus forecast residual demand |


## OpenAPI

````yaml get /api/v1/grid/system-state
openapi: 3.0.3
info:
  title: Power Signals API
  version: 1.0.0
  description: >-
    Clean, normalized, developer-ready datasets for energy traders, quants, and
    analysts.
  contact:
    email: support@powersignals.co.za
  license:
    name: Proprietary
servers:
  - url: https://api.powersignals.co.za
    description: Production
security: []
tags:
  - name: Generation
    description: Generation mix by fuel type (dispatchable + renewable)
  - name: Grid
    description: South African grid system state data
  - name: Features
    description: Derived analytical signals (Grid Stress Index, etc.)
paths:
  /api/v1/grid/system-state:
    get:
      tags:
        - Grid
      summary: Get grid system state
      description: >-
        Returns South African grid system state data for the given time range.
        Supports hourly (1h) and daily (1d) intervals. Requires API key
        authentication.
      operationId: getGridSystemState
      parameters:
        - in: query
          name: end
          schema:
            type: string
          description: End datetime in ISO-8601 format (e.g. 2026-01-02T00:00:00Z).
          required: true
        - in: query
          name: interval
          schema:
            type: string
            enum:
              - 1d
              - 1h
          description: Data resolution. Defaults to 1h.
        - in: query
          name: start
          schema:
            type: string
          description: Start datetime in ISO-8601 format (e.g. 2026-01-01T00:00:00Z).
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GridSystemStateResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
      security:
        - ApiKeyAuth: []
components:
  schemas:
    GridSystemStateResponse:
      type: object
      properties:
        meta:
          $ref: '#/components/schemas/GridSystemStateMeta'
        data:
          type: array
          items:
            type: object
            additionalProperties: {}
      required:
        - data
        - meta
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        detail:
          type: string
      required:
        - detail
        - error
    GridSystemStateMeta:
      type: object
      properties:
        dataset:
          type: string
          default: grid.system_state
        interval:
          $ref: '#/components/schemas/IntervalEnum'
        timezone:
          type: string
          default: UTC
        schema_version:
          type: string
          default: '1.0'
        derived:
          type: boolean
        start:
          type: string
        end:
          type: string
      required:
        - derived
        - end
        - interval
        - start
    IntervalEnum:
      enum:
        - 1h
        - 1d
      type: string
      description: |-
        * `1h` - 1h
        * `1d` - 1d
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API key obtained from the Power Signals dashboard.

````