Free plan

Extract Tables

Pull tables out of a PDF into a spreadsheet
POST
/v1/pdfs/tables

About this tool

This tool finds tables in a PDF by looking at where the words sit on each page, and gives them back as data you can open in a spreadsheet. It works on PDFs with real text, not on pictures of pages. Finding tables is a best guess and each one has a confidence score, so check the result. You can get one table as CSV (a plain table file) or all as an Excel workbook.
For example, you pull the tables of a financial report into Excel instead of retyping the numbers.

How to use it

  1. Choose this tool.
  2. Add your PDF.
  3. Choose the pages to look at, and the output: on screen, a CSV file, or an Excel workbook.
  4. If needed, choose which table to export and how sure the tool must be to keep one.
  5. Press Generate, then download or copy the result.

What you get back

You get the tables on screen, or a CSV or Excel file with the table rows and columns. You can download or copy it.
GOOD TO KNOW
Tables are found from text positions: ruled-line tables without gaps, merged cells and scanned pages are not supported (run /v1/pdfs/ocr first).
TEST IT LIVE

Try Extract Tables in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
PDFs
Plan
Free
Method
POST
Endpoint
/v1/pdfs/tables
Tool ID
pdfs.tables
Authentication
API key
Accepts
PDF
Background jobs
Yes
Usage group
Pdf
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/pdfs/tables" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'file=@document.pdf' \
  -F 'format=json' \
  -F 'table=1' \
  -F 'min_confidence=0.5'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.pdfs.tables({
    "file": 'document.pdf',
    "format": "json",
    "table": 1,
    "min_confidence": 0.5
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->pdfs()->tables([
    'file' => 'document.pdf',
    'format' => 'json',
    'table' => 1,
    'min_confidence' => 0.5,
]);
echo $result->requestId;
FAQ

Frequently asked questions

Find the tables of a PDF from the positions of its text and return them as JSON (default), one CSV table or an XLSX workbook with one sheet per table, with the confidence of each detection.

Extract Tables accepts PDF. You can send several files in one request.

Extract Tables is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/pdfs/tables with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.