{
  "openapi": "3.0.1",
  "info": {
    "title": "TAIFEX Options Chain — 台指選擇權逐履約價行情 API",
    "description": "Full Taiwan options chain by strike and expiry, back to the first TAIEX options session in 2001-12-24, with the exchange's own published Delta joined on. TXO, sector, gold and stock options. Every row re-checks the change against the previous settlement price.",
    "version": "0.1",
    "x-build-id": "f5EkdoN0BB3Git8TP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/chamarix~taifex-options-chain/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-chamarix-taifex-options-chain",
        "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/chamarix~taifex-options-chain/runs": {
      "post": {
        "operationId": "runs-sync-chamarix-taifex-options-chain",
        "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/chamarix~taifex-options-chain/run-sync": {
      "post": {
        "operationId": "run-sync-chamarix-taifex-options-chain",
        "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": {
          "contracts": {
            "title": "Contracts",
            "type": "array",
            "description": "Contract codes as the exchange prints them: TXO (TAIEX options), TEO, TFO, TGO, or a stock-option code such as CDO (TSMC), DHO (Hon Hai), NYO (Yuanta Taiwan 50 ETF). Use ALL for every listed contract, which is roughly 11,800 rows a session and is capped at three monthly downloads. Leave empty for TXO.",
            "default": [
              "TXO"
            ],
            "items": {
              "type": "string"
            }
          },
          "startDate": {
            "title": "Start date (YYYY-MM-DD)",
            "pattern": "^(|\\d{4}[-/]?\\d{2}[-/]?\\d{2})$",
            "type": "string",
            "description": "First trading day to fetch. Leave both dates empty for the latest session. The archive starts at 2001-12-24, the first TAIEX options session; a contract listed later simply returns nothing for the years before it existed.",
            "default": ""
          },
          "endDate": {
            "title": "End date (YYYY-MM-DD)",
            "pattern": "^(|\\d{4}[-/]?\\d{2}[-/]?\\d{2})$",
            "type": "string",
            "description": "Last trading day to fetch, inclusive. The exchange serves at most one month per download, so a range is split into monthly requests — 24 of them per run for named contracts, 3 when ALL is asked for.",
            "default": ""
          },
          "callPut": {
            "title": "Calls, puts or both",
            "enum": [
              "ALL",
              "CALL",
              "PUT"
            ],
            "type": "string",
            "description": "Filters the chain after it is parsed, so the consistency checks still run on the whole download either way.",
            "default": "ALL"
          },
          "tradingSession": {
            "title": "Trading session",
            "enum": [
              "ALL",
              "REGULAR",
              "AFTER_HOURS"
            ],
            "type": "string",
            "description": "TAIFEX runs two sessions a day and publishes a row for each. REGULAR (一般) is the daytime session and is the only one that carries settlement prices and open interest; AFTER_HOURS (盤後) is the overnight session, which prints volume and prices but a dash for open interest.",
            "default": "ALL"
          },
          "onlyTraded": {
            "title": "Only strikes that traded",
            "type": "boolean",
            "description": "Drops rows with zero volume. A full chain quotes hundreds of strikes that never trade in a session; the exchange still prints a row for each, with dashes where the prices would be.",
            "default": false
          },
          "minOpenInterest": {
            "title": "Minimum open interest",
            "minimum": 0,
            "type": "integer",
            "description": "Keeps only strikes carrying at least this many open contracts. Applies to the regular session, since after-hours rows do not report open interest.",
            "default": 0
          },
          "includeDelta": {
            "title": "Join the exchange's published Delta",
            "type": "boolean",
            "description": "TAIFEX publishes an official Delta per strike, so no pricing model is needed. It covers the latest session only, so it is joined on when the run includes that session and left null otherwise. Costs two extra requests.",
            "default": true
          },
          "crossCheck": {
            "title": "Cross-check against the open-data feeds",
            "type": "boolean",
            "description": "The exchange publishes the latest session a second time through its open-data API, and publishes a put/call ratio computed independently of both. With this on, the parsed chain is compared against them value by value and the result is written to the log. Costs two extra requests.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}