{
  "openapi": "3.0.1",
  "info": {
    "title": "Taiwan Corporate Action Prices — 減資分割參考價 API",
    "description": "Every point at which a Taiwan share price legitimately jumps without the company changing: capital reductions, par value changes and ETF splits, back to 2011. Fourteen official tables joined into one adjustment factor per event, every price re-derived and checked.",
    "version": "0.1",
    "x-build-id": "rXA6Re1ggHIeXGQ91"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/chamarix~taiwan-corporate-action-prices/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-chamarix-taiwan-corporate-action-prices",
        "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-corporate-action-prices/runs": {
      "post": {
        "operationId": "runs-sync-chamarix-taiwan-corporate-action-prices",
        "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-corporate-action-prices/run-sync": {
      "post": {
        "operationId": "run-sync-chamarix-taiwan-corporate-action-prices",
        "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": {
          "startDate": {
            "title": "Start date (YYYY-MM-DD)",
            "pattern": "^(|\\d{4}[-/]\\d{2}[-/]\\d{2})$",
            "type": "string",
            "description": "First resumption date to cover. Leave empty for the whole archive — TWSE rejects anything before 2011-01-01, so that is the floor. The archive is only about 740 events in all, and every historical table takes a date range of any length in a single request, so the events themselves cost fourteen requests and under a minute. The time goes on the per-reduction detail lookups below.",
            "default": ""
          },
          "endDate": {
            "title": "End date (YYYY-MM-DD)",
            "pattern": "^(|\\d{4}[-/]\\d{2}[-/]\\d{2})$",
            "type": "string",
            "description": "Last resumption date to cover, inclusive. Leave empty to run 400 days past today, because announcements point into the future — an ETF split announced in September can resume in November.",
            "default": ""
          },
          "market": {
            "title": "Market",
            "enum": [
              "both",
              "twse",
              "tpex"
            ],
            "type": "string",
            "description": "Both boards, or one of them. The listed board carries every ETF split Taiwan has ever had; the OTC board ships its exchange ratios inside the row, so it costs no detail requests.",
            "default": "both"
          },
          "actionTypes": {
            "title": "Action types",
            "type": "array",
            "description": "Which kinds of price discontinuity to collect. Leave empty for all four. Capital reductions are by far the most common — about 700 of the 740 events on record.",
            "items": {
              "type": "string",
              "enum": [
                "CAPITAL_REDUCTION",
                "PAR_VALUE_CHANGE",
                "ETF_SPLIT",
                "ETF_REVERSE_SPLIT"
              ],
              "enumTitles": [
                "Capital reduction — 減資 (~700 events since 2011)",
                "Par value change — 變更股票面額 (~25)",
                "ETF split — ETF分割 (~6, listed board only)",
                "ETF reverse split — ETF反分割 (~6, listed board only)"
              ]
            },
            "default": []
          },
          "records": {
            "title": "Records",
            "enum": [
              "both",
              "resumed",
              "announced"
            ],
            "type": "string",
            "description": "RESUMED is the historical record — the price the share actually reopened at, with the pre-halt close beside it, so the adjustment factor is known. ANNOUNCED is what the exchanges have pending: the ratio and the dates are published, but no price yet, because the pre-halt close has not happened.",
            "default": "both"
          },
          "stockCodes": {
            "title": "Security codes",
            "type": "array",
            "description": "Keep only these securities, e.g. 2323, 0050. Leave empty for every event. Filtering happens after the fetch, so it cuts the output rather than the request count — but it does cut the per-row detail lookups, which is where the requests actually go.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "fetchReductionDetails": {
            "title": "Fetch the exchange ratio for listed reductions",
            "type": "boolean",
            "description": "TPEx ships the exchange ratio, the cash returned per share and the par values inside every row at no cost. TWSE keeps them behind one request per reduction and throttles those requests, so the Actor paces itself to whatever the exchange is tolerating. With this on, a listed reduction carries its official ratio and its reference price is checked against it; with it off, the row still carries the reference price and the adjustment factor derived from the prices themselves. A full listed backfill is about 400 extra requests and measures around ten minutes — narrow the date range or turn this off if that matters.",
            "default": true
          },
          "maxDetailRequests": {
            "title": "Maximum detail requests",
            "minimum": 0,
            "type": "integer",
            "description": "A safety cap on the per-row lookups above, so an accidental full backfill does not become a surprise bill. When a run exceeds it the most recent events are looked up. Set 0 to lift it.",
            "default": 500
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}