Files
wehub-resource-sync e904b667c6
PaddleOCR PR Tests GPU / test-pr-gpu (push) Blocked by required conditions
PaddleOCR PR Tests / test-pr (push) Blocked by required conditions
PaddleOCR PR Tests / test-pr-python (3.8) (push) Waiting to run
Build/Publish Develop Docs / deploy (push) Failing after 1s
PaddleOCR Code Style Check / check-code-style (push) Failing after 1s
PaddleOCR PR Tests GPU / detect-changes (push) Failing after 1s
PaddleOCR PR Tests GPU / test-pr-gpu-impl (push) Waiting to run
PaddleOCR PR Tests / detect-changes (push) Failing after 1s
PaddleOCR PR Tests / test-pr-python (3.13) (push) Waiting to run
PaddleOCR PR Tests / test-pr-python (3.9) (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 11:59:26 +08:00
..

PaddleOCR TypeScript SDK

English | 简体中文

TypeScript client for the PaddleOCR official API. It submits OCR and document parsing jobs to hosted PaddleOCR services; it does not perform local OCR inference.

Official user docs:

Install

npm install @paddleocr/api-sdk

This package follows SemVer and is published as a public scoped npm package.

For local development:

npm install
npm run build

Minimal Usage

Set PADDLEOCR_ACCESS_TOKEN or pass token to the client:

export PADDLEOCR_ACCESS_TOKEN="your-access-token"
import { Model, PaddleOCRClient } from "@paddleocr/api-sdk";

const client = new PaddleOCRClient();
const result = await client.ocr({
  model: Model.PPOCRv5,
  fileUrl: "https://example.com/invoice.pdf",
});

console.log(result.jobId, result.pages.length);

Specify model: Model.PPOCRv6 (or "PP-OCRv6") to use the PP-OCRv6 hosted OCR model. Use Model.PPOCRv5Latin (or "PP-OCRv5-latin") for the PP-OCRv5 Latin-script hosted OCR model.

Document parsing defaults to PaddleOCR-VL-1.6:

const doc = await client.parseDocument({
  filePath: "./report.pdf",
  options: {
    useChartRecognition: true,
  },
});

console.log(doc.jobId, doc.pages.length);

Build And Test

npm run lint
npm run build
npm test
npm audit --audit-level=moderate