For the complete documentation index, see llms.txt. This page is also available as Markdown.

Parse an HTML Table to JSON

An example request that uses Gaffa to extract structured data (JSON) from a table on a webpage

The following example is a prebuilt request that demonstrates Gaffa's capabilities on our demo site. You can run this request right here in the Gaffa API Playground.

This example demonstrates how to extract tabular data from any webpage without writing a scraper. Gaffa renders the page using a real browser, waits for the table to load, and returns the rows as a clean JSON array, making it perfect for building data pipelines, monitoring dashboards, or feeding structured data into LLM workflows.

API Request

The request below uses the POST endpoint to load a demo table page, waits for the table element to appear, and parses each row into a structured JSON array, using the table's header row as property names.

{
  "url": "https://demo.gaffa.dev/simulate/table?loadTime=1&rowCount=3",
  "proxy_location": null,
  "async": false,
  "max_cache_age": 0,
  "settings": {
    "record_request": false,
    "actions": [
      {
        "type": "wait",
        "selector": "table",
        "timeout": 5000
      },
      {
        "type": "parse_table",
        "selector": "table"
      }
    ]
  }
}

Actions

WaitParse Table

Response

The parse_table action returns an output URL pointing to the extracted JSON:

Fetching that URL gives you the table rows as a ready-to-use array:

Last updated