{
  "openapi": "3.0.1",
  "info": {
    "title": "Taiwan Regular Savings Plan Rankings — ETF & Stock 定期定額",
    "description": "Taiwan's monthly regular savings plan (定期定額) league table: the top 20 stocks and top 20 ETFs by number of investor accounts paying in, every month back to 2020-10, with month-on-month account and rank moves, plus the securities firms licensed to run the scheme.",
    "version": "0.1",
    "x-build-id": "DaI2IEsh2XCCneMgs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/chamarix~taiwan-etf-regular-investment/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-chamarix-taiwan-etf-regular-investment",
        "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-etf-regular-investment/runs": {
      "post": {
        "operationId": "runs-sync-chamarix-taiwan-etf-regular-investment",
        "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-etf-regular-investment/run-sync": {
      "post": {
        "operationId": "run-sync-chamarix-taiwan-etf-regular-investment",
        "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": "RANKING is one record per security per month — its rank, how many accounts paid into it, and how both moved. MONTHLY_SUMMARY is one record per month for the two league tables as a whole. BROKER is the register of securities firms licensed to run the scheme.",
            "items": {
              "type": "string",
              "enum": [
                "RANKING",
                "MONTHLY_SUMMARY",
                "BROKER"
              ],
              "enumTitles": [
                "RANKING — one security, one month",
                "MONTHLY_SUMMARY — both tables in one row per month",
                "BROKER — securities firms running the scheme"
              ]
            },
            "default": [
              "RANKING",
              "MONTHLY_SUMMARY"
            ]
          },
          "startMonth": {
            "title": "Start month (YYYY-MM)",
            "pattern": "^(|\\d{4}[-/]?\\d{2})$",
            "type": "string",
            "description": "First month to fetch, e.g. 2020-10 — the first month the exchange ever published. Leave empty for the newest published month. The exchange publishes a month on the 7th trading day of the month after it.",
            "default": ""
          },
          "endMonth": {
            "title": "End month (YYYY-MM)",
            "pattern": "^(|\\d{4}[-/]?\\d{2})$",
            "type": "string",
            "description": "Last month to fetch, inclusive. Leave empty to fetch only the start month. One month is one request, so the whole archive since 2020-10 is around 70 requests.",
            "default": ""
          },
          "securityTypes": {
            "title": "Which league table",
            "type": "array",
            "description": "The report ranks stocks and ETFs separately and side by side. They are unrelated rankings — an ETF at rank 1 has nothing to do with the stock at rank 1. Both are fetched in the same request either way, so filtering here is free.",
            "items": {
              "type": "string",
              "enum": [
                "STOCK",
                "ETF"
              ],
              "enumTitles": [
                "STOCK — the listed-share table",
                "ETF — the ETF table"
              ]
            },
            "default": [
              "STOCK",
              "ETF"
            ]
          },
          "securityCodes": {
            "title": "Security codes filter",
            "type": "array",
            "description": "Optional list of codes to keep, e.g. ['0050', '2330', '00878']. Only affects RANKING records; MONTHLY_SUMMARY is always computed over the full published table so its totals stay comparable.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "crossCheck": {
            "title": "Cross-check against the other publications",
            "type": "boolean",
            "description": "Compare the newest month against its open-data mirror value by value, check every ranked code and name against the exchange's own listing, and reconcile the two securities-firm publications. Costs up to three requests and never changes the output.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}