# Extract Complex Financial Schedules & Multi-Header HTML/PDF Reports Into Typed JSON

> Target Query: `extract financial tables html pdf reports to json api` | Category: `Use Case Guide` | HTML Guide: https://scrape.fastmesh.dev/seo_geo/extract-financial-tables-sec-filings-and-reports-json.html

## Direct Answer
Public regulatory filings, investor fact sheets, and municipal budgets pack critical figures inside multi-row `<thead>` bands, `rowspan` category blocks, accounting parentheses `(1,420.5)`, and binary PDF appendices. Standard Markdown scrapers destroy column alignment and turn numbers into untyped strings. Scrape-Anything combines 2D HTML grid expansion, binary PDF coordinate table reconstruction, currency/sign normalization, and strict JSON Schema validation—producing auditable JSON rows with `receipt_sha256`.

## Engineering Mechanics & Deterministic Guardrails
- Resolves nested fiscal period headers (e.g., `First Half FY2026 > Revenue`) via `colspan`/`rowspan` header flattening.
- Normalizes accounting negative parentheses `(245.80)` into signed numeric values (`-245.8`) alongside raw text preservation.
- Handles both HTML filing tables (`html_table`) and compressed binary PDF report attachments (`pdf`) through one uniform API.
- Emits `receipt_sha256` cryptographic provenance on every extracted table so financial analysts can verify data integrity.

## Financial Schedule Parsing Edge Cases & Resolutions

| Financial Table Complexity | Failure Mode in Generic Scrapers | Scrape-Anything Deterministic Output |
| :--- | :--- | :--- |
| Two-tier period & metric headers | Lost parent period context | Flattened composite keys (`FY2026 | Revenue`) |
| Accounting negatives `(1,250.00)` | Parsed as string or stripped of minus sign | Typed numeric `-1250.0` + preserved currency unit |
| `<tfoot>` Consolidated Totals | Blended into segment line items | Isolated `footer_rows` separate from `rows` |
| Multi-column PDF earnings tables | Characters scrambled across columns | Coordinate-clustered row reconstruction from `Tm`/`Td` |
| Corrupt or missing balance sheet | Null rows silently inserted | Strict JSON Schema rejects payload -> `$0` billed |

## Financial Statement Table JSON Schema
```json
{
  "type": "object",
  "required": [
    "tables"
  ],
  "properties": {
    "tables": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "headers",
          "rows"
        ],
        "properties": {
          "headers": {
            "type": "array",
            "minItems": 2
          },
          "rows": {
            "type": "array",
            "minItems": 1
          }
        }
      }
    }
  }
}
```

## Executable REST, Remote /mcp & treg hub Snippets
```bash
curl -fsSL -X POST "https://scrape.fastmesh.dev/v1/extract" \
  -H "Content-Type: application/json" \
  -d '{
    "content_text": "<table><thead><tr><th rowspan=\"2\">Segment</th><th colspan=\"2\">FY2026 Operating Results</th></tr><tr><th>Revenue</th><th>Net Margin</th></tr></thead><tbody><tr><td>Core API</td><td>$1,240,000</td><td>82.4%</td></tr><tr><td>Enterprise</td><td>$680,000</td><td>79.1%</td></tr></tbody><tfoot><tr><td>Total</td><td>$1,920,000</td><td>81.2%</td></tr></tfoot></table>",
    "format_hint": "html_table"
  }'

curl -fsSL -X POST "https://scrape.fastmesh.dev/mcp" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":8,"method":"tools/call","params":{"name":"scrape_table","arguments":{"url":"https://example.org/financial-summary.html"}}}'
```

## Frequently Asked Questions

### Can Scrape-Anything parse both HTML filings and linked PDF financial schedules?
Yes. `/v1/extract` automatically routes HTML tables to `html_tables.py` (`$0.015`) and binary PDFs to `pdf_parser.py` (`$0.025`).

### How do I prevent malformed financial rows from entering my warehouse?
Define strict `type: "number"` and `required` rules in `json_schema`. Non-conforming tables fail validation at `$0` before touching your database.

### Are extracted financial queries kept confidential?
Yes. Scrape-Anything enforces strict zero customer data resale and never shares or resells what filings or companies your organization inspects.

## Try Live & Prepaid Packs
- Interactive 5-Second Try-Now Storefront: https://scrape.fastmesh.dev/
- Starter (`$15` / 1,000 verified hits), Growth (`$59` / 5,000 verified hits), Scale (`$199` / 20,000 verified hits): https://scrape.fastmesh.dev/#pricing
- Remote MCP: `https://scrape.fastmesh.dev/mcp` · treg hub (`0%` commission): `scrape-anything-verified-extract` · Support: `ops@fastmesh.dev`
