{
  "openapi": "3.1.0",
  "info": {
    "title": "Ellerva Elpris-API",
    "description": "Realtids spotpris för svenska elområden SE1–SE4 från Nord Pool. Tillhandahålls av Ellerva.se.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://ellerva.se"
    }
  ],
  "paths": {
    "/api/spot-prices": {
      "get": {
        "operationId": "getSpotPrices",
        "summary": "Hämta aktuella spotpriser per elområde",
        "description": "Returnerar dagens min-, max- och snittpris i öre/kWh för SE1, SE2, SE3 och SE4.",
        "responses": {
          "200": {
            "description": "Aktuella spotpriser",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "date": {
                      "type": "string"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "areas": {
                      "type": "object",
                      "properties": {
                        "SE1": {
                          "$ref": "#/components/schemas/Area"
                        },
                        "SE2": {
                          "$ref": "#/components/schemas/Area"
                        },
                        "SE3": {
                          "$ref": "#/components/schemas/Area"
                        },
                        "SE4": {
                          "$ref": "#/components/schemas/Area"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Area": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "min": {
            "type": "number"
          },
          "max": {
            "type": "number"
          },
          "avg": {
            "type": "number"
          }
        }
      }
    }
  }
}