{
  "openapi": "3.0.1",
  "info": {
    "title": "Taiwan Futures Daily — TAIFEX 期貨日行情 API",
    "description": "Every TAIFEX futures contract's daily bar, back to the first TAIEX futures session on 1998-07-21. OHLC, volume, settlement price and open interest for 384 contracts across both sessions, plus the large-trader open interest report.",
    "version": "0.1",
    "x-build-id": "ak6DoNimEFtF9vgem"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/chamarix~taiwan-futures-daily/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-chamarix-taiwan-futures-daily",
        "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~taiwan-futures-daily/runs": {
      "post": {
        "operationId": "runs-sync-chamarix-taiwan-futures-daily",
        "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~taiwan-futures-daily/run-sync": {
      "post": {
        "operationId": "run-sync-chamarix-taiwan-futures-daily",
        "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 this export prints them: TX (TAIEX futures), MTX (mini), TMF (micro), TE, TF, XIF, GDF, or a stock-futures code such as CDF (TSMC). Note the export writes TAIEX futures as TX, not the TXF shown on the exchange's product pages — asking for TXF returns no rows. Use ALL for every listed contract, roughly 2,400 rows a session, capped at three monthly downloads. Leave empty for TX.",
            "default": [
              "TX"
            ],
            "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 1998-07-21, the first TAIEX futures 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 31 days 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": ""
          },
          "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 the only one carrying settlement prices and open interest; AFTER_HOURS (盤後) is the overnight session, which prints volume and prices but a dash for open interest. Both share the same trading date, so a key that leaves the session out overwrites half the data.",
            "default": "ALL"
          },
          "includeCalendarSpreads": {
            "title": "Include calendar spreads",
            "type": "boolean",
            "description": "The exchange quotes each contract's month-against-month spreads as rows of their own, roughly one row in five. A spread is an order type rather than a position: its close is a price difference, and the exchange prints no settlement price, no open interest and no change for it. Off by default so that summing volume or open interest over the output cannot double-count; the consistency checks run over the whole download either way.",
            "default": false
          },
          "onlyTraded": {
            "title": "Only contracts that traded",
            "type": "boolean",
            "description": "Drops rows with zero volume. The exchange prints a row for every listed expiry whether or not anyone traded it, with dashes where the prices would be.",
            "default": false
          },
          "minOpenInterest": {
            "title": "Minimum open interest",
            "minimum": 0,
            "type": "integer",
            "description": "Keeps only contracts carrying at least this many open positions. Applies to the regular session, since after-hours rows do not report open interest.",
            "default": 0
          },
          "includeLargeTraderOI": {
            "title": "Include the large-trader open interest report",
            "type": "boolean",
            "description": "Adds LARGE_TRADER_OI records: the top five and top ten traders' long and short open interest per contract group, split between all traders and specific institutions, with each side's share of the market worked out. The exchange compiles it from position files rather than from trades, so it doubles as an independent check on the quotes — the run reconciles its market open interest against the downloaded quotes and reports the result. Covers the latest session only; a historical run gets nothing extra. Costs one request.",
            "default": true
          },
          "crossCheck": {
            "title": "Cross-check against the open-data feed",
            "type": "boolean",
            "description": "The exchange publishes the latest session a second time through its open-data API. With this on, the parsed download is compared against it value by value and the result is written to the log. Costs one extra request.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}