Documentation

Client Libraries & SDKs

Source-only Python and Node.js clients for the current Parsurai API surface. Not published to PyPI or npm.


The repository includes Python and TypeScript clients under sdks/python and sdks/node. They wrap extraction, duplicate checks, vendor analytics, usage, and feedback.

These clients are not published. There is no official Parsurai SDK on PyPI or npm yet, and pip install invoiceextract / npm install @invoiceextract/sdk do not resolve. Building from a checkout of the repository, as shown below, is for local evaluation only and is not a supported integration path. The REST API is the intended supported integration surface once the production endpoint is configured and Parsurai has publicly launched.

Both clients still carry a default base_url of https://api.invoiceextract.com. That hostname is obsolete, is not operated by Parsurai, and must never be used. Always pass the base URL explicitly, as every example on this page does.

Every example below uses https://api.parsurai.com, the production API host.

Python SDK

Install from source

From a checkout of the repository:

pip install ./sdks/python

Quick start

from invoiceextract import InvoiceExtract

client = InvoiceExtract(api_key="sk_live_your_key_here", base_url="https://api.parsurai.com")

result = client.extract(
    text="Invoice from Acme Ltd. INV-2026-001. Total: 1200 GBP.",
    locale="auto",
)
print(result.invoice["total_amount"])

duplicate = client.check_duplicate(invoice_id=result.invoice_id)
print(duplicate.score, duplicate.reason)

vendors = client.vendor_analytics(limit=10)
print(vendors.items)

usage = client.usage()
print(usage.calls_this_month, usage.quota)

For file extraction, pass PDF bytes:

with open("invoice.pdf", "rb") as file_obj:
    result = client.extract(pdf_bytes=file_obj.read(), locale="auto")

Node.js / TypeScript SDK

Install from source

Build the client in a checkout of the repository, then depend on that directory from your project:

cd sdks/node
npm install
npm run build
npm install file:/path/to/invoice-extractor/sdks/node

The package name in the checkout is still @invoiceextract/sdk; that is the name you import, not a package you can install from npm.

Quick start

import { InvoiceExtract } from '@invoiceextract/sdk';

const client = new InvoiceExtract({
  apiKey: 'sk_live_your_key_here',
  baseUrl: 'https://api.parsurai.com',
});

const result = await client.extract({
  text: 'Invoice from Acme Ltd. INV-2026-001. Total: 1200 GBP.',
  locale: 'auto',
});
console.log(result.invoice.total_amount);

const duplicate = await client.checkDuplicate({ invoiceId: result.invoice_id });
console.log(duplicate.score, duplicate.reason);

const vendors = await client.vendorAnalytics({ limit: 10 });
console.log(vendors.items);

const usage = await client.usage();
console.log(usage.calls_this_month, usage.quota);

For PDF uploads in the TypeScript client, pass a base64-encoded PDF:

const resultFromPdf = await client.extract({
  pdfBase64,
  locale: 'auto',
});

Supported Client Methods

CapabilityPythonTypeScript
Extract text, URL, or PDF bytes/base64extractextract
Duplicate checkcheck_duplicatecheckDuplicate
Vendor analyticsvendor_analyticsvendorAnalytics
Usage summaryusageusage
Submit field feedbacksubmit_feedbacksubmitFeedback