{
  "openapi": "3.0.1",
  "info": {
    "title": "Mexico Day-Ahead & Historical Power Prices (CENACE): Hourly",
    "description": "Unofficial. Hourly CENACE nodal (PML) and load-zone (PEND) prices for SIN, BCA and BCS: tomorrow's day-ahead (MDA) or historical backfill since 2016, plus real-time (MTR) about 7 days later. Energy, loss and congestion components. Not affiliated with or endorsed by CENACE.",
    "version": "1.0",
    "x-build-id": "SdMUOgBxTIydTmYwk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/plainworktools~mexico-power-prices-cenace/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-plainworktools-mexico-power-prices-cenace",
        "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/plainworktools~mexico-power-prices-cenace/runs": {
      "post": {
        "operationId": "runs-sync-plainworktools-mexico-power-prices-cenace",
        "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/plainworktools~mexico-power-prices-cenace/run-sync": {
      "post": {
        "operationId": "run-sync-plainworktools-mexico-power-prices-cenace",
        "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",
        "properties": {
          "priceType": {
            "title": "Price type",
            "enum": [
              "zone",
              "nodal"
            ],
            "type": "string",
            "description": "Load-zone prices (PEND, CENACE SW-PEND) or nodal prices (PML, CENACE SW-PML).",
            "default": "zone"
          },
          "market": {
            "title": "Market",
            "enum": [
              "MDA",
              "MTR"
            ],
            "type": "string",
            "description": "MDA = day-ahead market, published for tomorrow (D+1). MTR = real-time market results, which CENACE publishes about 7 days after the operating day (D-7); MTR is never live.",
            "default": "MDA"
          },
          "loadZones": {
            "title": "Load zones",
            "type": "array",
            "description": "Load zone names, used when Price type is Load zone. Spaces or hyphens both work (\"LA PAZ\" or \"LA-PAZ\"). The system (SIN, BCA, BCS) comes from the bundled CENACE NodosP catalogue. 1-200 per run.",
            "default": [
              "MEXICALI",
              "CULIACAN"
            ],
            "items": {
              "type": "string"
            }
          },
          "nodes": {
            "title": "Nodes (NodosP codes)",
            "type": "array",
            "description": "CENACE NodoP codes such as 01PLO-115, used when Price type is Node. The system comes from the bundled NodosP catalogue, or from System for codes the catalogue does not list. 1-200 per run.",
            "default": [
              "01PLO-115"
            ],
            "items": {
              "type": "string"
            }
          },
          "system": {
            "title": "System (only for codes missing from the catalogue)",
            "enum": [
              "SIN",
              "BCA",
              "BCS"
            ],
            "type": "string",
            "description": "SIN (national interconnected), BCA (Baja California) or BCS (Baja California Sur). Needed only for nodes or zones that are not in the bundled catalogue; catalogue codes always use their own system."
          },
          "dateMode": {
            "title": "Dates",
            "enum": [
              "tomorrow",
              "lastNDays",
              "range"
            ],
            "type": "string",
            "description": "tomorrow = the next operating day (D+1 in the system's time zone, MDA only); lastNDays = the N most recent operating days that can be published (MDA up to tomorrow, MTR up to 7 days ago); range = Start date to End date.",
            "default": "tomorrow"
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "First operating day (YYYY-MM-DD), used only when Dates is range. On or after 2016-01-01; days before the market's first day are reported as beforeMarketStart and not charged."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Last operating day (YYYY-MM-DD), used only when Dates is range. At most 366 days after Start date, and no later than tomorrow (MDA) or 7 days ago (MTR)."
          },
          "lastNDays": {
            "title": "Number of days (last N days)",
            "minimum": 1,
            "maximum": 366,
            "type": "integer",
            "description": "How many operating days to return when Dates is lastNDays (1-366).",
            "default": 7
          },
          "maxRows": {
            "title": "Max rows (spend cap)",
            "minimum": 1,
            "maximum": 10000000,
            "type": "integer",
            "description": "Stop after this many price rows. Whole location-days are delivered, so a run never returns more rows than this. The run's maximum total charge is honoured too.",
            "default": 50000
          },
          "useApifyProxy": {
            "title": "Use Apify datacenter proxy",
            "type": "boolean",
            "description": "Off by default: the Actor calls CENACE directly. Turn on only if direct access fails from the Apify cloud; it uses Apify's datacenter proxy, never residential.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}