{
  "openapi": "3.0.1",
  "info": {
    "title": "Taiwan Treasury Stock Buybacks — 庫藏股 Filings API",
    "description": "Every treasury-stock buyback ever filed in Taiwan: all 5,800+ board resolutions on the TWSE, TPEX and public-issue boards since 2000, with the planned size, price band and window, and — once the window closes — how much of it the company actually executed and at what average price.",
    "version": "0.1",
    "x-build-id": "zhBNAawwA018CZGxA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/chamarix~taiwan-treasury-stock-buybacks/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-chamarix-taiwan-treasury-stock-buybacks",
        "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-treasury-stock-buybacks/runs": {
      "post": {
        "operationId": "runs-sync-chamarix-taiwan-treasury-stock-buybacks",
        "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-treasury-stock-buybacks/run-sync": {
      "post": {
        "operationId": "run-sync-chamarix-taiwan-treasury-stock-buybacks",
        "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": {
          "recordTypes": {
            "title": "What to fetch",
            "type": "array",
            "description": "BUYBACK is one record per filed buyback — the board resolution, the plan, and the execution once the window closes. COMPANY_TOTAL is the exchange's own all-time total per company. Both come out of the same request, so asking for both is free.",
            "items": {
              "type": "string",
              "enum": [
                "BUYBACK",
                "COMPANY_TOTAL"
              ],
              "enumTitles": [
                "BUYBACK — one filed buyback per record",
                "COMPANY_TOTAL — all-time totals per company"
              ]
            },
            "default": [
              "BUYBACK"
            ]
          },
          "markets": {
            "title": "Markets",
            "type": "array",
            "description": "One request per market, each returning that board's full archive. The emerging board is not offered: §28-2 of the Securities and Exchange Act only lets listed and OTC companies buy their own shares back, and the report is empty for it.",
            "items": {
              "type": "string",
              "enum": [
                "TWSE",
                "TPEX",
                "PUBLIC"
              ],
              "enumTitles": [
                "TWSE — listed companies (上市)",
                "TPEX — OTC companies (上櫃)",
                "PUBLIC — public-issue companies (公開發行)"
              ]
            },
            "default": [
              "TWSE",
              "TPEX"
            ]
          },
          "startDate": {
            "title": "Start date (YYYY-MM-DD)",
            "pattern": "^(|\\d{4}[-/]?\\d{2}[-/]?\\d{2})$",
            "type": "string",
            "description": "Keep buybacks whose board resolution falls on or after this date. Leave empty for everything back to 2000-08-09, the oldest filing on record. Filtering is free — the report has no date parameter, so one request always returns the full archive.",
            "default": ""
          },
          "endDate": {
            "title": "End date (YYYY-MM-DD)",
            "pattern": "^(|\\d{4}[-/]?\\d{2}[-/]?\\d{2})$",
            "type": "string",
            "description": "Keep buybacks whose board resolution falls on or before this date, inclusive. Leave empty for no upper bound.",
            "default": ""
          },
          "stockCodes": {
            "title": "Company codes filter",
            "type": "array",
            "description": "Optional list of company codes to keep, e.g. ['2330', '2317']. Codes are not always numeric — 永豐金證 files as 0009A0 — so they are matched as text.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "purposes": {
            "title": "Buyback purposes",
            "type": "array",
            "description": "The purpose the company declared to the regulator. Leave empty for all three. Purpose is the single most informative field here: a buyback to transfer shares to employees is a compensation decision, while one to defend the company's credit and shareholder interest is a response to the share price.",
            "items": {
              "type": "string",
              "enum": [
                "EMPLOYEE_TRANSFER",
                "SHARE_CONVERSION",
                "CREDIT_AND_SHAREHOLDER_INTEREST"
              ],
              "enumTitles": [
                "EMPLOYEE_TRANSFER — 轉讓股份予員工",
                "SHARE_CONVERSION — 股權轉換",
                "CREDIT_AND_SHAREHOLDER_INTEREST — 維護公司信用及股東權益"
              ]
            },
            "default": []
          },
          "onlyInProgress": {
            "title": "Only buybacks still running",
            "type": "boolean",
            "description": "Keep only buybacks the company has not yet reported as finished — the ones whose execution figures are still blank. Useful as a daily watchlist of open buying programmes. Ignored for COMPANY_TOTAL records.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}