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"
}
Extractions
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.
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
Query Parameters
Response
Successful Response
A stored extraction record from the Retab API.