Skip to main content
GET
/
v1
/
extractions
/
{extraction_id}
/
sources
from retab import Retab

client = Retab()

result = client.extractions.sources("extr_01G34H8J2K")
print(result)
{
  "object": "extraction.sources",
  "extraction_id": "extr_01G34H8J2K",
  "document_type": "pdf",
  "file": {
    "id": "file_abc123",
    "filename": "invoice_001.pdf",
    "mime_type": "application/pdf"
  },
  "extraction": {
    "invoice_number": "INV-1032",
    "customer": {
      "name": "Acme Inc."
    },
    "total_amount": 1240.00
  },
  "sources": {
    "invoice_number": {
      "value": "INV-1032",
      "source": {
        "content": "INV-1032",
        "anchor": {
          "kind": "pdf_bbox",
          "page": 1,
          "left": 0.60,
          "top": 0.12,
          "width": 0.25,
          "height": 0.03
        }
      }
    },
    "customer": {
      "name": {
        "value": "Acme Inc.",
        "source": {
          "content": "Acme Inc.",
          "anchor": {
            "kind": "pdf_bbox",
            "page": 1,
            "left": 0.10,
            "top": 0.25,
            "width": 0.30,
            "height": 0.03
          }
        }
      }
    },
    "total_amount": {
      "value": 1240.00,
      "source": {
        "content": "1,240.00",
        "anchor": {
          "kind": "pdf_bbox",
          "page": 1,
          "left": 0.65,
          "top": 0.85,
          "width": 0.20,
          "height": 0.03
        }
      }
    }
  }
}
from retab import Retab

client = Retab()

result = client.extractions.sources("extr_01G34H8J2K")
print(result)
{
  "object": "extraction.sources",
  "extraction_id": "extr_01G34H8J2K",
  "document_type": "pdf",
  "file": {
    "id": "file_abc123",
    "filename": "invoice_001.pdf",
    "mime_type": "application/pdf"
  },
  "extraction": {
    "invoice_number": "INV-1032",
    "customer": {
      "name": "Acme Inc."
    },
    "total_amount": 1240.00
  },
  "sources": {
    "invoice_number": {
      "value": "INV-1032",
      "source": {
        "content": "INV-1032",
        "anchor": {
          "kind": "pdf_bbox",
          "page": 1,
          "left": 0.60,
          "top": 0.12,
          "width": 0.25,
          "height": 0.03
        }
      }
    },
    "customer": {
      "name": {
        "value": "Acme Inc.",
        "source": {
          "content": "Acme Inc.",
          "anchor": {
            "kind": "pdf_bbox",
            "page": 1,
            "left": 0.10,
            "top": 0.25,
            "width": 0.30,
            "height": 0.03
          }
        }
      }
    },
    "total_amount": {
      "value": 1240.00,
      "source": {
        "content": "1,240.00",
        "anchor": {
          "kind": "pdf_bbox",
          "page": 1,
          "left": 0.65,
          "top": 0.85,
          "width": 0.20,
          "height": 0.03
        }
      }
    }
  }
}

Authorizations

Api-Key
string
header
required

Path Parameters

extraction_id
string
required

Query Parameters

access_token
string | null

Response

Successful Response

extraction_id
string
required

ID of the extraction

document_type
enum<string>
required

Detected document type of the source file

Available options:
pdf,
image,
csv,
xlsx,
docx,
txt
file
BaseMIMEData · object
required

File metadata (id, filename, mime_type). Use the Files API to download the content.

extraction
Extraction · object
required

Original extraction output

sources
Sources · object
required

Same shape as extraction but leaves are {value, source} objects

object
string
default:extraction.sources
Allowed value: "extraction.sources"