curl -X GET https://api.tableflow.com/v2/extractions/uT2bJNWN75YPU95r \
-H "Authorization: Bearer YOUR_API_KEY"
const axios = require("axios");
async function getExtraction(extractionId) {
try {
const response = await axios.get(
`https://api.tableflow.com/v2/extractions/${extractionId}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
},
}
);
console.log(response.data);
return response.data;
} catch (error) {
console.error(error);
throw error;
}
}
getExtraction("uT2bJNWN75YPU95r")
.then(extraction => {
console.log(`Extracted data for ${extraction.file_name}`);
});
import requests
def get_extraction(extraction_id):
url = f"https://api.tableflow.com/v2/extractions/{extraction_id}"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
response.raise_for_status() # Raise exception for 4XX/5XX responses
return response.json()
# Example usage
try:
extraction = get_extraction("uT2bJNWN75YPU95r")
print(f"Extracted data for {extraction['file_name']}")
except requests.exceptions.HTTPError as e:
print(f"Error fetching extraction: {e}")
{
"id": "uT2bJNWN75YPU95r",
"workspace_id": "dk4g1tUg1uHLs8YU",
"template_id": "JlLZVabDjYWzu7C9",
"template_name": "Invoice Template",
"file_name": "acme-invoice-apr2023.pdf",
"file_size": 245872,
"file_type": {
"key": "document",
"extension": "pdf",
"mime_type": "application/pdf"
},
"status": "completed",
"status_history": [
{
"status": "processing",
"time": 1682366228,
"message": "File uploaded"
},
{
"status": "completed",
"time": 1682366240,
"message": "Extraction completed"
}
],
"created_at": 1682366228,
"updated_at": 1682366240,
"data": {
"fields": {
"values": {
"invoice_number": "INV-20230415",
"invoice_date": "2023-04-15",
"customer_name": "Acme Corporation",
"payment_terms": "Net 30",
"total_amount": "1245.75"
},
"validations": {}
},
"tables": {
"line_items": {
"pagination": {
"offset": 0,
"limit": 100,
"total": 2,
"next_offset": null,
"filter": "all"
},
"rows": [
{
"index": 0,
"values": {
"description": "Ergonomic Office Chair",
"quantity": "1",
"unit_price": "249.99",
"amount": "249.99"
},
"validations": {}
},
{
"index": 1,
"values": {
"description": "Wireless Keyboard",
"quantity": "2",
"unit_price": "59.95",
"amount": "119.90"
},
"validations": {}
}
]
}
}
},
"stats": {
"fields": {
"valid": 5,
"invalid": 0,
"total": 5
},
"tables": {
"line_items": {
"rows": {
"valid": 2,
"invalid": 0,
"total": 2
},
"columns": {
"total": 4
}
}
}
},
"template": {
"id": "JlLZVabDjYWzu7C9",
"name": "Invoice Template",
"fields": [
{
"key": "invoice_number",
"name": "Invoice Number",
"data_type": "string"
}
],
"tables": [
{
"key": "line_items",
"name": "Line Items",
"columns": [
{
"key": "description",
"name": "Description",
"data_type": "string"
}
]
}
]
}
}
Extractions
Extraction
Get extraction by ID
GET
/
v2
/
extractions
/
{id}
curl -X GET https://api.tableflow.com/v2/extractions/uT2bJNWN75YPU95r \
-H "Authorization: Bearer YOUR_API_KEY"
const axios = require("axios");
async function getExtraction(extractionId) {
try {
const response = await axios.get(
`https://api.tableflow.com/v2/extractions/${extractionId}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
},
}
);
console.log(response.data);
return response.data;
} catch (error) {
console.error(error);
throw error;
}
}
getExtraction("uT2bJNWN75YPU95r")
.then(extraction => {
console.log(`Extracted data for ${extraction.file_name}`);
});
import requests
def get_extraction(extraction_id):
url = f"https://api.tableflow.com/v2/extractions/{extraction_id}"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
response.raise_for_status() # Raise exception for 4XX/5XX responses
return response.json()
# Example usage
try:
extraction = get_extraction("uT2bJNWN75YPU95r")
print(f"Extracted data for {extraction['file_name']}")
except requests.exceptions.HTTPError as e:
print(f"Error fetching extraction: {e}")
{
"id": "uT2bJNWN75YPU95r",
"workspace_id": "dk4g1tUg1uHLs8YU",
"template_id": "JlLZVabDjYWzu7C9",
"template_name": "Invoice Template",
"file_name": "acme-invoice-apr2023.pdf",
"file_size": 245872,
"file_type": {
"key": "document",
"extension": "pdf",
"mime_type": "application/pdf"
},
"status": "completed",
"status_history": [
{
"status": "processing",
"time": 1682366228,
"message": "File uploaded"
},
{
"status": "completed",
"time": 1682366240,
"message": "Extraction completed"
}
],
"created_at": 1682366228,
"updated_at": 1682366240,
"data": {
"fields": {
"values": {
"invoice_number": "INV-20230415",
"invoice_date": "2023-04-15",
"customer_name": "Acme Corporation",
"payment_terms": "Net 30",
"total_amount": "1245.75"
},
"validations": {}
},
"tables": {
"line_items": {
"pagination": {
"offset": 0,
"limit": 100,
"total": 2,
"next_offset": null,
"filter": "all"
},
"rows": [
{
"index": 0,
"values": {
"description": "Ergonomic Office Chair",
"quantity": "1",
"unit_price": "249.99",
"amount": "249.99"
},
"validations": {}
},
{
"index": 1,
"values": {
"description": "Wireless Keyboard",
"quantity": "2",
"unit_price": "59.95",
"amount": "119.90"
},
"validations": {}
}
]
}
}
},
"stats": {
"fields": {
"valid": 5,
"invalid": 0,
"total": 5
},
"tables": {
"line_items": {
"rows": {
"valid": 2,
"invalid": 0,
"total": 2
},
"columns": {
"total": 4
}
}
}
},
"template": {
"id": "JlLZVabDjYWzu7C9",
"name": "Invoice Template",
"fields": [
{
"key": "invoice_number",
"name": "Invoice Number",
"data_type": "string"
}
],
"tables": [
{
"key": "line_items",
"name": "Line Items",
"columns": [
{
"key": "description",
"name": "Description",
"data_type": "string"
}
]
}
]
}
}
Retrieves extraction data by ID, including fields, tables, and document information.
Usage Notes
- This endpoint returns extraction data including all fields
- For tables, it includes up to 100 rows per table (the default pagination limit)
- For tables with more than 100 rows, use the pagination information from each table and the Get Extraction Table Rows endpoint to retrieve additional rows
Request
string
required
The ID of the extraction to retrieve.
curl -X GET https://api.tableflow.com/v2/extractions/uT2bJNWN75YPU95r \
-H "Authorization: Bearer YOUR_API_KEY"
const axios = require("axios");
async function getExtraction(extractionId) {
try {
const response = await axios.get(
`https://api.tableflow.com/v2/extractions/${extractionId}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
},
}
);
console.log(response.data);
return response.data;
} catch (error) {
console.error(error);
throw error;
}
}
getExtraction("uT2bJNWN75YPU95r")
.then(extraction => {
console.log(`Extracted data for ${extraction.file_name}`);
});
import requests
def get_extraction(extraction_id):
url = f"https://api.tableflow.com/v2/extractions/{extraction_id}"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
response.raise_for_status() # Raise exception for 4XX/5XX responses
return response.json()
# Example usage
try:
extraction = get_extraction("uT2bJNWN75YPU95r")
print(f"Extracted data for {extraction['file_name']}")
except requests.exceptions.HTTPError as e:
print(f"Error fetching extraction: {e}")
Response
string
The unique identifier for the extraction.
string
The ID of the workspace this extraction belongs to.
string
The ID of the template used for extraction.
string
The name of the template used for extraction.
string
The name of the uploaded file.
integer
The size of the uploaded file in bytes.
object
string
The current status of the extraction (e.g., “processing”, “completed”, “failed”).
array
History of status changes for this extraction.
string
Error message if the extraction failed.
object
Additional metadata associated with the extraction.
integer
Unix timestamp when the extraction was created.
integer
Unix timestamp when the extraction was last updated.
object
The extracted data.
Show data
Show data
object
Field data extracted from the document.
object
Map of table keys to their data and pagination information.
Note: This endpoint includes up to 100 rows per table. For tables with more rows, use the pagination information and the Get Extraction Table Rows endpoint to retrieve additional rows.
Show tables
Show tables
object
object
Pagination information for this table.
array
Array of table rows, limited to first 100 rows. For complete access to all rows, use the Get Extraction Table Rows endpoint.
object
Statistics about the extraction data.
Show stats
Show stats
object
object
Map of table keys to their statistics.
Show tables
Show tables
object
object
object
Column statistics for this table.
object
The template used at the time of extraction.
{
"id": "uT2bJNWN75YPU95r",
"workspace_id": "dk4g1tUg1uHLs8YU",
"template_id": "JlLZVabDjYWzu7C9",
"template_name": "Invoice Template",
"file_name": "acme-invoice-apr2023.pdf",
"file_size": 245872,
"file_type": {
"key": "document",
"extension": "pdf",
"mime_type": "application/pdf"
},
"status": "completed",
"status_history": [
{
"status": "processing",
"time": 1682366228,
"message": "File uploaded"
},
{
"status": "completed",
"time": 1682366240,
"message": "Extraction completed"
}
],
"created_at": 1682366228,
"updated_at": 1682366240,
"data": {
"fields": {
"values": {
"invoice_number": "INV-20230415",
"invoice_date": "2023-04-15",
"customer_name": "Acme Corporation",
"payment_terms": "Net 30",
"total_amount": "1245.75"
},
"validations": {}
},
"tables": {
"line_items": {
"pagination": {
"offset": 0,
"limit": 100,
"total": 2,
"next_offset": null,
"filter": "all"
},
"rows": [
{
"index": 0,
"values": {
"description": "Ergonomic Office Chair",
"quantity": "1",
"unit_price": "249.99",
"amount": "249.99"
},
"validations": {}
},
{
"index": 1,
"values": {
"description": "Wireless Keyboard",
"quantity": "2",
"unit_price": "59.95",
"amount": "119.90"
},
"validations": {}
}
]
}
}
},
"stats": {
"fields": {
"valid": 5,
"invalid": 0,
"total": 5
},
"tables": {
"line_items": {
"rows": {
"valid": 2,
"invalid": 0,
"total": 2
},
"columns": {
"total": 4
}
}
}
},
"template": {
"id": "JlLZVabDjYWzu7C9",
"name": "Invoice Template",
"fields": [
{
"key": "invoice_number",
"name": "Invoice Number",
"data_type": "string"
}
],
"tables": [
{
"key": "line_items",
"name": "Line Items",
"columns": [
{
"key": "description",
"name": "Description",
"data_type": "string"
}
]
}
]
}
}
Error Responses
string
Error message describing what went wrong.
{
"error": "No extraction ID provided"
}
⌘I