{
  "openapi": "3.0.1",
  "info": {
    "title": "HTML Table Extractor: Web Tables to CSV, JSON, Excel",
    "description": "Extract HTML tables from web pages or raw HTML into JSON rows keyed by header, with optional CSV and Excel files: colspan/rowspan, header detection, number cleanup, robots.txt respected. Empty input = free demo. Failed pages are free.",
    "version": "0.1",
    "x-build-id": "bpsIXLwar9ttf9S8y"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ucchiii~html-table-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ucchiii-html-table-extractor",
        "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/ucchiii~html-table-extractor/runs": {
      "post": {
        "operationId": "runs-sync-ucchiii-html-table-extractor",
        "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/ucchiii~html-table-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-ucchiii-html-table-extractor",
        "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": {
          "urls": {
            "title": "Page URLs",
            "maxItems": 10000,
            "type": "array",
            "description": "Full page URLs starting with http:// or https:// that contain HTML tables. Only these pages are fetched (no crawling, no login); internal or private addresses are refused. Leave URLs and HTML empty for a free demo.",
            "items": {
              "type": "string"
            }
          },
          "htmlStrings": {
            "title": "Raw HTML strings",
            "maxItems": 10000,
            "type": "array",
            "description": "Raw HTML documents to read tables from, one string per document (up to 5 MB each). Use this when you already have the HTML, for example from your own scraper."
          },
          "baseUrl": {
            "title": "Source label for raw HTML",
            "type": "string",
            "description": "Optional http(s) URL written to _sourceUrl for the raw HTML strings. If empty, _sourceUrl is html#0, html#1 and so on."
          },
          "tableSelector": {
            "title": "Table selector (CSS)",
            "type": "string",
            "description": "Optional CSS selector, e.g. table.wikitable or #prices. It can point at a table or at a container whose tables you want. Empty means every table on the page."
          },
          "tableIndexes": {
            "title": "Table indexes",
            "type": "array",
            "description": "Optional list of 0-based positions of the tables to keep, counted among the tables the selector matched, e.g. [0, 2]. Empty means all matched tables.",
            "items": {
              "type": "integer",
              "minimum": 0
            }
          },
          "minRows": {
            "title": "Minimum data rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Skip tables with fewer data rows than this (the header is not counted). Use 2 or more to ignore layout tables and tiny widgets.",
            "default": 1
          },
          "maxTablesPerPage": {
            "title": "Max tables per page",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Stop reading a page after this many tables. Each table is charged once, so this caps the cost per page.",
            "default": 50
          },
          "headerMode": {
            "title": "Header detection",
            "enum": [
              "auto",
              "first_row",
              "none"
            ],
            "type": "string",
            "description": "How column names are found. Auto uses thead or the leading rows made of th cells and merges multi-row headers; empty names become column_N and duplicates get a _2 suffix.",
            "default": "auto"
          },
          "fillSpans": {
            "title": "Repeat merged cells",
            "type": "boolean",
            "description": "Expand colspan and rowspan: the merged value is repeated in every cell it covers, so each row is complete. If off, only the first cell holds the value and the rest are empty.",
            "default": true
          },
          "numericCleanup": {
            "title": "Convert numbers",
            "type": "boolean",
            "description": "Turn values like $1,234.50, 12% or (5) into numbers (1234.5, 12, -5). Text, dates and codes with leading zeros stay as they are. Percent signs and currency symbols are dropped.",
            "default": false
          },
          "saveCsv": {
            "title": "Save each table as CSV",
            "type": "boolean",
            "description": "Also store one CSV file per table in the key-value store. File keys are listed in the TABLES record.",
            "default": false
          },
          "saveXlsx": {
            "title": "Save each table as Excel",
            "type": "boolean",
            "description": "Also store one .xlsx file per table in the key-value store. File keys are listed in the TABLES record.",
            "default": false
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Skip pages that the site's robots.txt disallows for bots (they are free). Keep this on unless you have the site owner's permission to ignore it.",
            "default": true
          },
          "maxRetries": {
            "title": "Retries on temporary errors",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "How often a page is retried after a timeout, connection error, 429 or 502/503/504, waiting 1, 2, 4 seconds and so on (or the server's Retry-After). Allowed range 0 to 5.",
            "default": 3
          },
          "timeoutSecs": {
            "title": "Timeout (seconds)",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout for each page request, in seconds. Allowed range 1 to 120 (default 20).",
            "default": 20
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many pages are processed at once, across different sites. Each host gets one request at a time, at least 1 second apart. Allowed range 1 to 5.",
            "default": 3
          },
          "userAgent": {
            "title": "User-Agent",
            "type": "string",
            "description": "Optional custom User-Agent header. The default identifies this Actor as a generic bot that fetches only the URLs you provide."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}