DocPeeldocs

Quickstart

Send your first document and get back structured fields in under five minutes.

1. Create an API key

Visit Dashboard → API Keys and click Create key. Copy the secret immediately.

2. Install the SDK

npm install @doc-peel/sdk

3. Submit a document

import { DocPeel } from '@doc-peel/sdk';
import fs from 'node:fs';

const client = new DocPeel({ apiKey: process.env.DOCPEEL_API_KEY });

// DocPeel takes documents as base64 in a JSON body.
const fileB64 = fs.readFileSync('./invoice.pdf').toString('base64');

const extraction = await client.extractions.create({
  file:     fileB64,
  fileName: 'invoice.pdf',
});

console.log(extraction.fields);

Or use cURL

# Encode the file to base64, then POST as JSON
FILE_B64=$(base64 -i ./invoice.pdf)

curl https://api.docpeel.com/v1/extractions \
  -H "Authorization: Bearer dpk_live_••••••••••••" \
  -H "Content-Type: application/json" \
  -d "{\"file\": \"$FILE_B64\", \"file_name\": \"invoice.pdf\"}"

What you get back

{
  "extraction": {
    "id": "ext_01HZX...",
    "status": "completed",
    "file_name": "invoice.pdf",
    "confidence": 96,
    "fields": [
      { "field": "Invoice Number", "value": "INV-2024-081", "confidence": 99 },
      { "field": "Total",          "value": "$2,840.00",    "confidence": 98 },
      { "field": "Due Date",       "value": "2024-12-15",   "confidence": 95 }
    ],
    "credits_used": 1,
    "created_at": "2024-08-12T10:23:01Z"
  },
  "request_id": "req_01HZX..."
}

Next steps