{
  "openapi": "3.0.1",
  "info": {
    "title": "Hellenic and Balkan Energy Market Tracker",
    "description": "Unifies Greek/SEE energy data from ADMIE (IPTO), HEnEx and ENTSO-E into one hourly JSON dataset: load, RES forecast vs actual, curtailment MW, clearing prices, SMP, cross-border flows, grid-stress indicator and webhook alerts.",
    "version": "1.2",
    "x-build-id": "BtRcc2uujVBEDXs9J"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mpelas~gr-see-energy-grid-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mpelas-gr-see-energy-grid-tracker",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/mpelas~gr-see-energy-grid-tracker/runs": {
      "post": {
        "operationId": "runs-sync-mpelas-gr-see-energy-grid-tracker",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/mpelas~gr-see-energy-grid-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-mpelas-gr-see-energy-grid-tracker",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "dateFrom"
        ],
        "properties": {
          "dateFrom": {
            "title": "Start date (YYYY-MM-DD)",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2}|today|yesterday)$",
            "type": "string",
            "description": "First day to fetch. Accepts YYYY-MM-DD, or the keywords 'today' / 'yesterday'. Defaults to yesterday."
          },
          "dateTo": {
            "title": "End date (YYYY-MM-DD)",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2}|today|yesterday)$",
            "type": "string",
            "description": "Last day to fetch (inclusive). Defaults to dateFrom. Range is capped at 31 days."
          },
          "includeAdmieData": {
            "title": "Fetch ADMIE (IPTO) grid files & forecasts",
            "type": "boolean",
            "description": "Queries the ADMIE Operation & Market Files API (getOperationMarketFilewRange) for load, RES generation/forecast and balancing files.",
            "default": true
          },
          "admieCategories": {
            "title": "ADMIE file categories",
            "type": "array",
            "description": "ADMIE FileCategory codes to request. Verified working on the live portal (2026-11): RealTimeSCADA* actuals, ISP1/2/3 forecasts (15-min MTU), SystemRealizationSCADA, RESMV, IMBABE. Legacy names like DayAheadLoadForecast or ExPostImbalancePricingResults return no files anymore. When several versions of a file exist (_01, _02...), only the latest is used.",
            "items": {
              "type": "string"
            },
            "default": [
              "RealTimeSCADASystemLoad",
              "RealTimeSCADARES",
              "RealTimeSCADAImportsExports",
              "SystemRealizationSCADA",
              "ISP1DayAheadLoadForecast",
              "ISP1DayAheadRESForecast",
              "ISP2DayAheadLoadForecast",
              "ISP2DayAheadRESForecast",
              "ISP3IntraDayLoadForecast",
              "ISP3IntraDayRESForecast",
              "RESMV",
              "IMBABE"
            ]
          },
          "includeHEnExPrices": {
            "title": "Fetch HEnEx day-ahead market results",
            "type": "boolean",
            "description": "Downloads the latest YYYYMMDD_EL-DAM_Results_EN_vNN xlsx package from enexgroup.gr and aggregates the 15-minute MTU clearing prices (MCP) to hourly: average, minimum quarter, and count of negative quarters, plus traded volume.",
            "default": true
          },
          "includeEntsoeFlows": {
            "title": "Fetch cross-border flows (ENTSO-E Transparency)",
            "type": "boolean",
            "description": "Queries the ENTSO-E Transparency Platform REST API for physical flows (A11/A16) on the GR borders (IT, BG, MK, AL, TR) in BOTH directions, returned as signed net flow (positive = into Greece), resolution-aware (PT15M/PT30M/PT60M). Requires a free ENTSO-E security token.",
            "default": false
          },
          "entsoeApiKey": {
            "title": "ENTSO-E security token (optional)",
            "type": "string",
            "description": "Free API token from https://transparency.entsoe.eu/. Required only when includeEntsoeFlows is true."
          },
          "alertWebhookUrl": {
            "title": "Alert webhook URL (optional)",
            "type": "string",
            "description": "HTTP endpoint (Slack/Discord/custom) that receives ONE JSON digest per run (all alerts grouped by day) when thresholds are breached."
          },
          "alertThresholds": {
            "title": "Alert thresholds",
            "type": "object",
            "description": "Trigger an alert when the curtailment proxy MW exceeds maxCurtailmentMW, or the hourly MCP (EUR/MWh) falls below minMCPPrice (negative-price alert; severity CRITICAL if any 15-min quarter was negative).",
            "default": {
              "maxCurtailmentMW": 300,
              "minMCPPrice": 0
            }
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional proxy for source requests (some operator portals rate-limit datacenter IPs).",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}