{
  "openapi": "3.0.1",
  "info": {
    "title": "HTML Table to JSON & CSV - Web Table Extractor",
    "description": "For AI agents and data pipelines: give a URL, get every HTML table on the page as JSON rows keyed by column name, with merged cells expanded, multi-row headers joined, numbers typed and footnotes removed. On 48 real pages, 454 tables matched what a browser draws, cell by cell. CSV too. Monitor mode.",
    "version": "0.1",
    "x-build-id": "Lgfds05rlvvyALCAa"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/neverempty~html-table-to-json/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-neverempty-html-table-to-json",
        "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/neverempty~html-table-to-json/runs": {
      "post": {
        "operationId": "runs-sync-neverempty-html-table-to-json",
        "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/neverempty~html-table-to-json/run-sync": {
      "post": {
        "operationId": "run-sync-neverempty-html-table-to-json",
        "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",
            "type": "array",
            "description": "Web pages whose HTML tables you want, one per line (1 to 1,000 per run). A URL without http:// or https:// is read as https://. The same URL given twice is read and charged once. If this is empty, the example page https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population is used.",
            "items": {
              "type": "string"
            }
          },
          "tableIndexes": {
            "title": "Only these tables (by position)",
            "type": "array",
            "description": "Return only the nth <table> elements of the page, counted from 1 in page order (the same numbering as the index field of each table and of otherTables). Example: 1 and 3. Empty means every data table.",
            "items": {
              "type": "string"
            }
          },
          "titleContains": {
            "title": "Only tables whose title contains",
            "type": "string",
            "description": "Return only tables whose caption, aria-label or nearest heading above the table contains this text (case does not matter). Example: GDP."
          },
          "columnContains": {
            "title": "Only tables with a column name containing",
            "type": "string",
            "description": "Return only tables that have a column whose name contains this text (case does not matter). Example: population."
          },
          "minRows": {
            "title": "Minimum data rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Skip tables with fewer data rows than this (1 to 100,000). Skipped tables are listed in otherTables.",
            "default": 1
          },
          "includeLayoutTables": {
            "title": "Also return layout tables",
            "type": "boolean",
            "description": "Also return tables that are used for page layout rather than data (one row or one column without header cells, only images, cells holding other tables or long paragraphs, role=\"presentation\", navigation boxes). Off by default; they are listed in otherTables with the reason.",
            "default": false
          },
          "stripFootnotes": {
            "title": "Remove footnote marks",
            "type": "boolean",
            "description": "Remove footnote marks from cells and captions: Wikipedia-style [1], [a], [note 3], [citation needed], and <sup> reference marks (class reference or footnote, or text like [2], *, †). The number of marks removed is in footnotesRemoved. Turn off to keep the cell text exactly as shown.",
            "default": true
          },
          "includeTextValues": {
            "title": "Also return the cells as written",
            "type": "boolean",
            "description": "Return rowsText next to rows: the same rows with every cell as the text shown on the page (for example \"$1,234.50\" where rows has 1234.5). Turn off for smaller output.",
            "default": true
          },
          "includeCsv": {
            "title": "Also return each table as CSV",
            "type": "boolean",
            "description": "Add a csv field to each table: RFC 4180 CSV with the column names as the first line and the cells as written.",
            "default": false
          },
          "includeLinks": {
            "title": "Also return the link in each cell",
            "type": "boolean",
            "description": "Add a links field to each table: for each row, the first link (absolute URL) found in each cell, keyed by column name.",
            "default": false
          },
          "maxRowsPerTable": {
            "title": "Maximum rows per table",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Return at most this many data rows per table (1 to 100,000). Rows left out are counted in rowsTruncated.",
            "default": 10000
          },
          "onlyChanges": {
            "title": "Monitor mode: only tables that changed",
            "type": "boolean",
            "description": "Return only pages where a selected table gained or lost rows since the last run with the same watch name, with only the tables that changed and the added rows in changes (plus pages new to the watch). The first run returns every page as the starting point. A change is re-read after 1.5 seconds and reported only if the table is the same in both reads; a table that differs between two reads a moment apart (live data) is not reported that time and is compared again next run. A run in which nothing changed returns a free row saying so and charges only the run start fee.",
            "default": false
          },
          "watchName": {
            "title": "Watch name",
            "type": "string",
            "description": "Name of the remembered state used to compare runs (letters, digits, dot, dash, underscore; up to 40). Setting it (or turning on monitor mode) fills changeType and changes. Use a different name for each list of pages you track on its own schedule. With monitor mode on and no name, the name \"default\" is used."
          },
          "resetMonitoringState": {
            "title": "Forget what this watch remembered",
            "type": "boolean",
            "description": "Start this watch over: forget the remembered tables before this run, so every page is returned as a first check.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Pages read at the same time",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many pages are read in parallel (1 to 8).",
            "default": 4
          },
          "requestTimeoutSecs": {
            "title": "Time limit per request (seconds)",
            "minimum": 5,
            "maximum": 60,
            "type": "integer",
            "description": "How long to wait for one page to answer (5 to 60 seconds). HTTP 429, 500, 502, 503 and 504 are asked again up to two more times; a page that does not answer in time is asked once more.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}