{
  "openapi": "3.0.1",
  "info": {
    "title": "Coordinador Eléctrico Chile – Costo Marginal y Generación",
    "description": "Normalized data from the official Coordinador Eléctrico Nacional (Chile) SIP API: marginal costs per bus, real generation, demand, plants, lines and outages, using your own free API key. Not affiliated with the Coordinador.",
    "version": "0.1",
    "x-build-id": "nVxw96peXYz0kcOjN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/better-llama~coordinador-electrico-chile/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-better-llama-coordinador-electrico-chile",
        "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/better-llama~coordinador-electrico-chile/runs": {
      "post": {
        "operationId": "runs-sync-better-llama-coordinador-electrico-chile",
        "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/better-llama~coordinador-electrico-chile/run-sync": {
      "post": {
        "operationId": "run-sync-better-llama-coordinador-electrico-chile",
        "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": [
          "apiKey"
        ],
        "properties": {
          "apiKey": {
            "title": "API Key (user_key) del Coordinador / API key",
            "type": "string",
            "description": "Tu credencial del Portal del Desarrollador del Coordinador (https://portal.api.coordinador.cl → Aplicaciones → Credencial). Se guarda cifrada y solo se usa para tus consultas; nunca se registra en logs. / Your developer-portal credential, stored encrypted, never logged."
          },
          "dataset": {
            "title": "Conjunto de datos / Dataset",
            "enum": [
              "costo_marginal_online",
              "costo_marginal_real",
              "generacion_real",
              "generacion_diaria",
              "demanda_neta",
              "demanda_real_estimada",
              "centrales",
              "lineas_transmision",
              "limitaciones_transmision",
              "instrucciones_sscc",
              "energia_no_suministrada"
            ],
            "type": "string",
            "description": "Qué consultar en el Sistema de Información Pública (SIP).",
            "default": "costo_marginal_online"
          },
          "startDate": {
            "title": "Desde / Start date",
            "type": "string",
            "description": "AAAA-MM-DD. Por defecto: ayer (hora de Chile). No aplica a los catálogos de centrales y líneas."
          },
          "endDate": {
            "title": "Hasta / End date",
            "type": "string",
            "description": "AAAA-MM-DD (incluido). Por defecto igual a startDate. Máximo 31 días por ejecución."
          },
          "filter": {
            "title": "Filtro de texto / Text filter",
            "type": "string",
            "description": "Opcional. Texto (sin mayúsculas/minúsculas) que debe aparecer en el nombre: barra en costos marginales (p. ej. «crucero 220», «QUILLOTA»), central o tecnología en generación, instalación o empresa en limitaciones. Se aplica después de descargar cada página (la API no filtra por barra)."
          },
          "includeRaw": {
            "title": "Incluir fila original / Include raw row",
            "type": "boolean",
            "description": "Agrega `raw` con la fila original, sin RUT, correos ni direcciones de contacto, ni nombres de personas naturales.",
            "default": false
          },
          "maxItems": {
            "title": "Máximo de resultados / Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Tope de registros entregados y cobrados (1-100000). Por defecto 500. Ojo: un día de costo marginal tiene ~145.000 filas (≈1.500 barras × 96 cuartos de hora); usa `filter` para una barra.",
            "default": 500
          },
          "pageSize": {
            "title": "Filas por página / Page size",
            "minimum": 10,
            "maximum": 5000,
            "type": "integer",
            "description": "Tamaño de página pedido a la API (10-5000). Por defecto 5000 (menos solicitudes).",
            "default": 5000
          },
          "maxPages": {
            "title": "Máximo de páginas / Max pages",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Tope de páginas por ejecución (1-500). Por defecto 40 (≈ un día completo de costos marginales con páginas de 5000).",
            "default": 40
          },
          "requestIntervalMs": {
            "title": "Pausa entre solicitudes (ms) / Request interval (ms)",
            "minimum": 200,
            "maximum": 10000,
            "type": "integer",
            "description": "Pausa mínima entre solicitudes (200-10000). Por defecto 1000. El gateway responde 429 ante ráfagas.",
            "default": 1000
          },
          "maxRetries": {
            "title": "Reintentos / Retries",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Reintentos ante errores transitorios (red, 429, 5xx). Por defecto 5.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}