apapyr
v1.0.0
Published
Extract structured data from invoices, receipts, and documents. PDF/image in, JSON out.
Maintainers
Readme
aPapyr Node.js SDK
Extract structured data from invoices, receipts, and documents. Send a PDF or image, get clean JSON back.
Install
npm install apapyrQuick Start
const { aPapyr } = require("apapyr");
const client = new aPapyr("sk_live_your_key");
// Extract data from an invoice
const result = await client.extract("invoice.pdf");
console.log(result.getField("vendor_name")); // "Acme Corp"
console.log(result.getField("total")); // 1250.00
console.log(result.confidence); // 0.97
// Get all fields as a flat object
console.log(result.toFlatDict());
// { document_type: "invoice", vendor_name: "Acme Corp", total: 1250.00, ... }AI Agent Support
aPapyr works natively with AI agents via MCP:
claude mcp add apapyr -- npx @apapyr/mcp-serverThen just ask: "Extract the data from invoice.pdf"
Document Types
invoice— vendor, total, tax, due_date, line_itemsreceipt— merchant, total, tax, tip, payment_methodw2— employer, wages, federal_tax, state_taxbank_statement— bank, balances, transactionscontract— parties, dates, value, obligationsauto— automatically detects type (default)
Environment Variable
export APAPYR_API_KEY=sk_live_your_keyconst client = new aPapyr(); // reads from env