Parsing your first receipt in Node.js
Get up and running in under 5 minutes using our official TypeScript SDK. You'll authenticate, process a local image, and receive a perfectly parsed JSON array.
1. Install the SDK
We distribute typed bindings that work natively with modern JavaScript Runtimes (Node, Deno, Bun) out of the box.
npm install @solveocr/client
2. Initialize Client
Obtain your API keys from the Dashboard and initialize a new SolveOCR instance.
import { SolveOCR } from '@solveocr/client';
const client = new SolveOCR({
apiKey: process.env.SOLVEOCR_API_KEY,
});
3. Extract Data
Call the extract() method, optionally specifying hints like expected language or table extraction modes.
const response = await client.extract('./receipt.jpg', {
mode: 'invoice',
languages: ['en', 'fr']
});
console.log('Total Due:', response.structuredData.total);
Tip: The
'invoice'mode automatically hunts for Totals, Line Items, and Tax IDs without manual regex!