HTML Tables to JSON & CSV avatar

HTML Tables to JSON & CSV

Pricing

from $1.00 / 1,000 saved tables

Go to Apify Store
HTML Tables to JSON & CSV

HTML Tables to JSON & CSV

Extract public HTML tables into structured JSON rows and optional per-table CSV files, with captions, headers, spans, source links and clear limits.

Pricing

from $1.00 / 1,000 saved tables

Rating

0.0

(0)

Developer

Akshay Aggarwal

Akshay Aggarwal

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Categories

Share

Turn published HTML tables into structured rows for analysis, spreadsheets and automation. Give the Actor public page URLs; it returns one dataset item per table with its caption, column headers, expanded rows and source link. Save a separate CSV file for each table when you need one.

Quick start

{
"pageUrls": ["https://www.w3.org/WAI/tutorials/tables/one-header/"],
"maxTables": 1,
"saveCsv": true
}

The example page has a table of event dates and venues. Its dataset item begins:

{
"source_url": "https://www.w3.org/WAI/tutorials/tables/one-header/",
"table_index": 0,
"caption": "",
"headers": ["Date", "Event", "Venue"],
"rows": [
["12 February", "Waltz with Strauss", "Main Hall"],
["24 March", "The Obelisks", "West Wing"],
["14 April", "The What", "Main Hall"]
],
"row_count": 3,
"column_count": 3,
"truncated": false,
"csv_key": "CSV_001_0000"
}

When saveCsv is true, open the csv_key record in the run's key-value store to download that table's CSV. When false, csv_key is omitted and no separate CSV files are created. The dataset is always JSON and has one item per saved table.

Inputs and limits

InputUse
pageUrls1–20 public HTTPS pages with HTML <table> elements.
tableIndexesOptional zero-based table indexes to select on each page. Leave out or use [] for all nonempty tables. Nested tables have their own indexes.
maxTablesMaximum saved tables across all pages, default 10, maximum 1,000.
maxRowsPerTableMaximum expanded rows per table including header rows, default 100, maximum 1,000.
maxCellsMaximum expanded cells per table, including rectangular padding, default 5,000, maximum 20,000.
saveCsvWrite a separate CSV record per saved table, default false.

The Actor reads public HTML returned by the page request. It does not sign in, render JavaScript, submit forms, or read tables inside PDFs or images. It follows public HTTPS redirects, accepts HTML responses up to 3 MiB, and caps each cell at 2,000 characters and total cell text at 500,000 characters per table. A source may also block automated requests. Check the run summary for errors and tables that reached limits.

Column headers come from <thead> or leading rows of <th> cells. Multirow headers are joined with |. Rowspan and colspan values are expanded into repeated cell values so every returned row has a consistent width. Row header cells within data rows remain in rows. Nested tables are separate items; their text is excluded from the parent cell. Empty tables are skipped. The Actor preserves table order and page order.

Results and billing

Each saved dataset item is one table, regardless of its cell or row count. For pay-per-result pricing, one saved table is one billable result; check the current price in Apify Console. The Actor stops collecting when its run charge limit is reached and reports unprocessed pages in OUTPUT. A table shortened by a row, cell or text limit has truncated: true and may still be saved. The summary in the run's OUTPUT key reports fetched pages, saved and skipped tables, page errors and limit reasons. Errors and summary records are never added to the table dataset.

Use row_count, column_count, truncated, and the run summary to judge whether a table covers what you need. HTML tables used only for page layout can appear too; use tableIndexes to select the ones you want.