SDK Overview
Choose the right SDK for your application
SDK Overview
LeapOCR provides official SDKs for popular programming languages, each designed to provide idiomatic APIs and excellent developer experience.
Choose Your SDK
SDK API Reference
Interactive endpoint docs generated from the OpenAPI spec
JavaScript/TypeScript
Full type safety for Node.js and browsers
Python
Async-first client with complete type hints
PHP
Modern PHP client with enums and typed exceptions
Go
Type-safe client with idiomatic Go API
REST API
Direct HTTP API access for any language
Quick Start Comparison
JavaScript/TypeScript
import { LeapOCR } from "leapocr";
const client = new LeapOCR({ apiKey: process.env.LEAPOCR_API_KEY });
const job = await client.ocr.processURL("https://example.com/doc.pdf");
const result = await client.ocr.waitUntilDone(job.jobId);Python
import asyncio
from leapocr import LeapOCR, ProcessOptions, Format
async def main():
async with LeapOCR(os.getenv("LEAPOCR_API_KEY")) as client:
result = await client.ocr.process_and_wait(
"https://example.com/doc.pdf"
)
asyncio.run(main())PHP
<?php
use LeapOCR\LeapOCR;
$client = new LeapOCR((string) getenv('LEAPOCR_API_KEY'));
$job = $client->ocr()->processUrl("https://example.com/doc.pdf");
$result = $client->ocr()->waitUntilDone($job->jobId);Go
import "github.com/leapocr/leapocr-go"
client, _ := ocr.New(os.Getenv("LEAPOCR_API_KEY"))
job, _ := client.ProcessURL(ctx, "https://example.com/doc.pdf")
result, _ := client.WaitUntilDone(ctx, job.ID)REST API
curl -X POST https://api.leapocr.com/ocr/uploads/url \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/doc.pdf"}'Installation
JavaScript/TypeScript
npm install leapocr
# or
yarn add leapocr
# or
pnpm add leapocrPython
pip install leapocr
# or
uv add leapocrPHP
composer require leapocr/leapocr-phpGo
go get github.com/leapocr/leapocr-goCommon Concepts
All SDKs share these core concepts. See the Concepts section for details:
- Processing Models: Choose from standard-v2 or pro-v2
- Output Formats: Structured or markdown
- Custom Schemas: Define extraction requirements
Next Steps
- Choose your SDK from the cards above
- Review the SDK API reference for the exact request and response shapes
- Follow the SDK-specific installation guide
- Review the Getting Started guide
- Explore Common Use Cases
Open Source
All SDKs are open source and available on GitHub:
- leapocr-js - JavaScript/TypeScript SDK
- leapocr-python - Python SDK
- leapocr-php - PHP SDK
- leapocr-go - Go SDK
Contributions are welcome! See each repository's CONTRIBUTING.md for guidelines.