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"
}
Get Extraction
Retrieve an extraction.
Returns the extraction identified by extraction_id, including its source
file, schema, output, and consensus details. Responds with 404 if no
matching extraction exists.
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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
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.
Unique identifier of the extraction
Information about the extracted file
Show child attributes
Show child attributes
Model used for the extraction
JSON schema used for the extraction
The extracted structured data
Number of consensus votes used
Free-form instructions supplied with the extraction request.
Lifecycle status. The synchronous path returns 'completed'. Background runs progress pending -> queued -> in_progress -> completed | failed | cancelled.
pending, queued, in_progress, completed, failed, cancelled Error details when a background run fails; null otherwise. Always present so consumers can read it without an existence check.
Show child attributes
Show child attributes
Consensus metadata for multi-vote extraction runs
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Usage information for the extraction
Show child attributes
Show child attributes