Skip to main content
Get Extractor
curl --request GET \
  --url https://api.doctly.ai/api/v1/e/{extractor_id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.doctly.ai/api/v1/e/{extractor_id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.doctly.ai/api/v1/e/{extractor_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.doctly.ai/api/v1/e/{extractor_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.doctly.ai/api/v1/e/{extractor_id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.doctly.ai/api/v1/e/{extractor_id}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.doctly.ai/api/v1/e/{extractor_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "987fcdeb-a654-3210-9876-543210987654",
  "name": "Invoice Extractor",
  "slug": "invoice-extractor",
  "description": "Extract invoice details including vendor information, line items, subtotals, taxes, and grand totals from PDF invoices.",
  "cost_type": "PER_PAGE",
  "cost_credits": 5
}
{
  "detail": "Extractor not found or you do not have access to it."
}
{
  "detail": [
    {
      "loc": ["path", "extractor_id"],
      "msg": "value is not a valid uuid",
      "type": "type_error.uuid"
    }
  ]
}
Get detailed information about a specific extractor including its configuration, pricing, and edit permissions.

Request

Headers

Authorization
string
required
Bearer token authentication. Example: Bearer YOUR_API_KEY

Path Parameters

extractor_id
string
required
The unique identifier (UUID) of the extractor

Example Request

curl https://api.doctly.ai/api/v1/e/987fcdeb-a654-3210-9876-543210987654 \
  -H "Authorization: Bearer YOUR_API_KEY"
import requests

extractor_id = "987fcdeb-a654-3210-9876-543210987654"
headers = {"Authorization": "Bearer YOUR_API_KEY"}

response = requests.get(
    f"https://api.doctly.ai/api/v1/e/{extractor_id}",
    headers=headers
)

extractor = response.json()
print(f"Name: {extractor['name']}")
print(f"Slug: {extractor['slug']}")
print(f"Cost: {extractor['cost_credits']} credits {extractor['cost_type'].lower()}")
const extractorId = '987fcdeb-a654-3210-9876-543210987654';

const response = await fetch(
  `https://api.doctly.ai/api/v1/e/${extractorId}`,
  {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  }
);

const extractor = await response.json();
console.log(`Name: ${extractor.name}`);
console.log(`Slug: ${extractor.slug}`);

Response

Example Responses

{
  "id": "987fcdeb-a654-3210-9876-543210987654",
  "name": "Invoice Extractor",
  "slug": "invoice-extractor",
  "description": "Extract invoice details including vendor information, line items, subtotals, taxes, and grand totals from PDF invoices.",
  "cost_type": "PER_PAGE",
  "cost_credits": 5
}
{
  "detail": "Extractor not found or you do not have access to it."
}
{
  "detail": [
    {
      "loc": ["path", "extractor_id"],
      "msg": "value is not a valid uuid",
      "type": "type_error.uuid"
    }
  ]
}

Using the Extractor

Once you have the extractor details, use the slug to run it:
import requests

# Get extractor details
extractor_id = "987fcdeb-a654-3210-9876-543210987654"
headers = {"Authorization": "Bearer YOUR_API_KEY"}

extractor = requests.get(
    f"https://api.doctly.ai/api/v1/e/{extractor_id}",
    headers=headers
).json()

# Run the extractor using its slug
slug = extractor["slug"]
with open("invoice.pdf", "rb") as f:
    files = {"file": ("invoice.pdf", f, "application/pdf")}
    response = requests.post(
        f"https://api.doctly.ai/api/v1/e/{slug}",
        headers=headers,
        files=files
    )

print(response.json())
const headers = { 'Authorization': 'Bearer YOUR_API_KEY' };

// Get extractor details
const extractorId = '987fcdeb-a654-3210-9876-543210987654';
const extractor = await fetch(
  `https://api.doctly.ai/api/v1/e/${extractorId}`,
  { headers }
).then(r => r.json());

// Run the extractor using its slug
const formData = new FormData();
formData.append('file', fileInput.files[0]);

const result = await fetch(
  `https://api.doctly.ai/api/v1/e/${extractor.slug}`,
  {
    method: 'POST',
    headers,
    body: formData
  }
).then(r => r.json());

console.log(result);

Authorizations

Authorization
string
header
required

API key authentication using Bearer token

Path Parameters

extractor_id
string<uuid>
required

Extractor ID

Response

Extractor details

id
string<uuid>
required
name
string
required
slug
string
required
cost_type
enum<string>
required
Available options:
PER_PAGE,
PER_DOCUMENT
cost_credits
integer
required
description
string | null