Skip to content

Extract Data Endpoint

Extract structured data from documents or text using a trained DeepTagger project.

Endpoint

POST /extract_data

Request

Headers

Header Required Description
x-api-key Yes Your DeepTagger API key
Content-Type Yes multipart/form-data for files, application/x-www-form-urlencoded for text

Parameters

Parameter Type Required Description
fo_id string Yes Project ID (e.g., fo_1759714105892)
file binary Conditional Document file (PDF, image). Required if no text
text string Conditional Raw text content. Required if no file

Examples

File Upload

curl -X POST https://deeptagger.com/api/v1/extract_data \
  -H "x-api-key: YOUR_API_KEY" \
  -F "fo_id=fo_1759714105892" \
  -F "file=@invoice.pdf"

Text Input

curl -X POST https://deeptagger.com/api/v1/extract_data \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "fo_id=fo_1759714105892" \
  -d "text=Invoice content here..."

Python

import requests

url = "https://deeptagger.com/api/v1/extract_data"
headers = {"x-api-key": "YOUR_API_KEY"}

# File upload
with open("invoice.pdf", "rb") as f:
    files = {"file": f}
    data = {"fo_id": "fo_1759714105892"}
    response = requests.post(url, headers=headers, data=data, files=files)

print(response.json())

JavaScript/Node.js

const FormData = require('form-data');
const fs = require('fs');
const axios = require('axios');

const form = new FormData();
form.append('fo_id', 'fo_1759714105892');
form.append('file', fs.createReadStream('invoice.pdf'));

axios.post('https://deeptagger.com/api/v1/extract_data', form, {
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    ...form.getHeaders()
  }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));

Response

Success (200 OK)

{
  "invoice_number": "INV-2025-001",
  "date": "2025-01-15",
  "total": "$1,234.56",
  "vendor": "Acme Corp"
}

The structure depends on your project configuration.

Errors

See Error Handling for detailed error responses.

Supported File Types

  • PDF (.pdf)
  • Images (.jpg, .jpeg, .png, .tiff)
  • Text (via text parameter)

Maximum file size: Check your plan limits.

Processing Time

  • Text: ~2-5 seconds
  • PDF: ~5-15 seconds
  • Images: ~3-10 seconds

Next Steps