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

client = Retab()

extraction = client.extractions.get("extr_01G34H8J2K")
print(extraction)
import { Retab } from "@retab/node";

const client = new Retab({ apiKey: process.env.RETAB_API_KEY });

const extraction = await client.extractions.get("extr_01G34H8J2K");
console.log(extraction);
package main

import (
	"context"
	"fmt"
	"log"

	retab "github.com/retab-dev/retab/clients/go"
)

func ptr[T any](v T) *T { return &v }

func main() {
	ctx := context.Background()

	client, err := retab.NewClient("")
	if err != nil {
		log.Fatal(err)
	}

	extraction, err := client.Extractions.Get(ctx, "extr_01G34H8J2K", nil)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(*extraction)
}
require 'retab'

client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])

extraction = client.extractions.get(extraction_id: 'extr_01G34H8J2K')
puts extraction
use retab::Retab;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Retab::new(std::env::var("RETAB_API_KEY")?);

    let extraction = client.extractions().get("extr_01G34H8J2K", retab::resources::extractions::GetParams::default()).await?;
    println!("{:?}", extraction);
    Ok(())
}
<?php
require 'vendor/autoload.php';

use Retab\Client;

$client = new Client(apiKey: getenv('RETAB_API_KEY'));

$result = $client->extractions()->get(
    extractionId: 'extr_01G34H8J2K',
);
print_r($result);
using Retab;
using RetabClient = Retab.Retab;

var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
var client = new RetabClient(apiKey);

var result = await client.Extractions.GetAsync("extr_01G34H8J2K");
Console.WriteLine(result);
import com.retab.RetabClient;

public final class Example {
  public static void main(String[] args) throws Exception {
    RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));

    var result = client.extractions().get("extr_abc123", null);
    System.out.println(result);
  }
}
curl -X 'GET' \
  'https://api.retab.com/v1/extractions/extr_01G34H8J2K' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <your-api-key>'
{
  "id": "extr_01G34H8J2K",
  "created_at": "2024-03-15T10:30:00Z",
  "file": {
    "id": "file_6dd6eb00688ad8d1",
    "filename": "invoice.pdf"
  },
  "output": {
    "invoice_number": "INV-2024-0042",
    "total_amount": 1234.56,
    "vendor_name": "Acme Corp",
    "line_items": [
      {
        "description": "Widget A",
        "quantity": 10,
        "unit_price": 99.99
      }
    ]
  },
  "json_schema": {
    "type": "object",
    "properties": {
      "invoice_number": { "type": "string" },
      "total_amount": { "type": "number" },
      "vendor_name": { "type": "string" },
      "line_items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "description": { "type": "string" },
            "quantity": { "type": "integer" },
            "unit_price": { "type": "number" }
          }
        }
      }
    }
  },
  "metadata": {
    "batch_id": "batch_2024_03"
  }
}
{
  "detail": "Extraction not found"
}
from retab import Retab

client = Retab()

extraction = client.extractions.get("extr_01G34H8J2K")
print(extraction)
import { Retab } from "@retab/node";

const client = new Retab({ apiKey: process.env.RETAB_API_KEY });

const extraction = await client.extractions.get("extr_01G34H8J2K");
console.log(extraction);
package main

import (
	"context"
	"fmt"
	"log"

	retab "github.com/retab-dev/retab/clients/go"
)

func ptr[T any](v T) *T { return &v }

func main() {
	ctx := context.Background()

	client, err := retab.NewClient("")
	if err != nil {
		log.Fatal(err)
	}

	extraction, err := client.Extractions.Get(ctx, "extr_01G34H8J2K", nil)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(*extraction)
}
require 'retab'

client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])

extraction = client.extractions.get(extraction_id: 'extr_01G34H8J2K')
puts extraction
use retab::Retab;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Retab::new(std::env::var("RETAB_API_KEY")?);

    let extraction = client.extractions().get("extr_01G34H8J2K", retab::resources::extractions::GetParams::default()).await?;
    println!("{:?}", extraction);
    Ok(())
}
<?php
require 'vendor/autoload.php';

use Retab\Client;

$client = new Client(apiKey: getenv('RETAB_API_KEY'));

$result = $client->extractions()->get(
    extractionId: 'extr_01G34H8J2K',
);
print_r($result);
using Retab;
using RetabClient = Retab.Retab;

var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
var client = new RetabClient(apiKey);

var result = await client.Extractions.GetAsync("extr_01G34H8J2K");
Console.WriteLine(result);
import com.retab.RetabClient;

public final class Example {
  public static void main(String[] args) throws Exception {
    RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));

    var result = client.extractions().get("extr_abc123", null);
    System.out.println(result);
  }
}
curl -X 'GET' \
  'https://api.retab.com/v1/extractions/extr_01G34H8J2K' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <your-api-key>'
{
  "id": "extr_01G34H8J2K",
  "created_at": "2024-03-15T10:30:00Z",
  "file": {
    "id": "file_6dd6eb00688ad8d1",
    "filename": "invoice.pdf"
  },
  "output": {
    "invoice_number": "INV-2024-0042",
    "total_amount": 1234.56,
    "vendor_name": "Acme Corp",
    "line_items": [
      {
        "description": "Widget A",
        "quantity": 10,
        "unit_price": 99.99
      }
    ]
  },
  "json_schema": {
    "type": "object",
    "properties": {
      "invoice_number": { "type": "string" },
      "total_amount": { "type": "number" },
      "vendor_name": { "type": "string" },
      "line_items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "description": { "type": "string" },
            "quantity": { "type": "integer" },
            "unit_price": { "type": "number" }
          }
        }
      }
    }
  },
  "metadata": {
    "batch_id": "batch_2024_03"
  }
}
{
  "detail": "Extraction not found"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

extraction_id
string
required

Query Parameters

include_output
boolean
default:true

When false, returns a cheap status-only projection (no output), served from cache for in-flight background runs.

Response

Successful Response

A stored extraction record from the Retab API.

id
string
required

Unique identifier of the extraction

file
FileRef · object
required

Information about the extracted file

model
string
required

Model used for the extraction

json_schema
Json Schema · object
required

JSON schema used for the extraction

output
Output · object
required

The extracted structured data

n_consensus
integer
default:1

Number of consensus votes used

instructions
string | null

Free-form instructions supplied with the extraction request.

status
enum<string>
default:pending

Lifecycle status. The synchronous path returns 'completed'. Background runs progress pending -> queued -> in_progress -> completed | failed | cancelled.

Available options:
pending,
queued,
in_progress,
completed,
failed,
cancelled
error
PrimitiveError · object | null

Error details when a background run fails; null otherwise. Always present so consumers can read it without an existence check.

consensus
ExtractionConsensus · object | null

Consensus metadata for multi-vote extraction runs

metadata
Metadata · object | null
usage
RetabUsage · object | null

Usage information for the extraction

created_at
string<date-time> | null