{
  "openapi": "3.0.1",
  "info": {
    "title": "Taiwan Corporate Bonds — 公司債、金融債與寶島債 API",
    "description": "Every corporate, bank and Formosa bond on the Taipei Exchange: issuance terms, outstanding balance, credit ratings, perpetuals and private placements, the 939-bond international register with ISINs, daily OTC trades since 2005 and the exchange's theoretical prices for USD bonds since 2017.",
    "version": "0.1",
    "x-build-id": "HKmhsS9EaeTFU6yYH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/chamarix~taiwan-corporate-bonds/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-chamarix-taiwan-corporate-bonds",
        "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-bonds/runs": {
      "post": {
        "operationId": "runs-sync-chamarix-taiwan-corporate-bonds",
        "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-bonds/run-sync": {
      "post": {
        "operationId": "run-sync-chamarix-taiwan-corporate-bonds",
        "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": "Four feeds, written to one dataset and told apart by record_type. 'issues' and 'international_issues' are current-state registers, one request per file. 'otc_trades' and 'theoretical_prices' are one stored file per trading session, so a date range is what they cost.",
            "items": {
              "type": "string",
              "enum": [
                "issues",
                "international_issues",
                "otc_trades",
                "theoretical_prices"
              ],
              "enumTitles": [
                "issues — corporate, bank & Formosa bond terms, balance, ratings",
                "international_issues — the international bond register with ISINs",
                "otc_trades — daily OTC trade summary per bond (since 2005)",
                "theoretical_prices — exchange fair values for USD bonds (since 2017)"
              ]
            },
            "default": [
              "issues",
              "international_issues",
              "otc_trades",
              "theoretical_prices"
            ]
          },
          "startDate": {
            "title": "Start date (YYYY-MM-DD)",
            "pattern": "^(|\\d{4}[-/]\\d{2}[-/]\\d{2})$",
            "type": "string",
            "description": "First session for otc_trades and theoretical_prices. Leave both dates empty for the latest published session only. OTC trade files start on 2005-05-23; theoretical prices on 2017-12-18 (callable zero-coupon), 2018-12-10 (callable fixed) and 2019-12-16 (non-callable fixed).",
            "default": ""
          },
          "endDate": {
            "title": "End date (YYYY-MM-DD)",
            "pattern": "^(|\\d{4}[-/]\\d{2}[-/]\\d{2})$",
            "type": "string",
            "description": "Last session, inclusive. Defaults to today when only a start date is given. Has no effect on the two registers, which are snapshots with no date of their own.",
            "default": ""
          },
          "bondCodes": {
            "title": "Bond codes",
            "type": "array",
            "description": "Keep only these bonds, e.g. F16801 (TSMC's 40-year USD Formosa bond), B99513, G11490. Applied to every record type. Leave empty for everything. The full checks still run on the whole market either way.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includePrivatePlacements": {
            "title": "Include private placements",
            "type": "boolean",
            "description": "The corporate master also lists about 770 privately placed bonds, which have no bond code and no public market but do have issuer, size, coupon and tenor. Off by default because they can never appear in the trades. Only affects 'issues'.",
            "default": false
          },
          "includeGovernmentBonds": {
            "title": "Include government bonds in OTC trades",
            "type": "boolean",
            "description": "The exchange's OTC trade file covers government paper too. It is left out by default — the taiwan-government-bonds Actor covers that market properly. Turn on to get the whole file. Only affects 'otc_trades'.",
            "default": false
          },
          "crossCheck": {
            "title": "Cross-check against independent official sources",
            "type": "boolean",
            "description": "Recompute every subtotal and reconcile the masters against the international register and the exchange's own bond search pages, and the stored price files against their openapi copy. A run whose data fails its own checks ends as FAILED rather than handing you bad numbers. Costs a few extra requests.",
            "default": true
          },
          "maxDownloads": {
            "title": "Maximum file downloads per feed",
            "minimum": 1,
            "type": "integer",
            "description": "A safety cap so an accidental twenty-year range does not become a surprise bill. A year is about 250 sessions per file. The run stops with an explanation instead of fetching past it.",
            "default": 400
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}