PDF Extraction API Guide: Use Cases, Limits, OCR & Tables

Learn how Tuko's Firecrawl PDF Inspector-powered API handles PDF parsing, OCR, tables, realistic business use cases, limits, and production responsibilities.

Tuko's PDF API lets a developer delegate request-time PDF parsing to Tuko instead of installing and operating the parser, rendering, OCR, and table-extraction dependencies inside their own application. The caller uploads a PDF, Tuko processes it temporarily on the server, and the caller receives a JSON response.

Powered by Firecrawl PDF Inspector v1.12.0

The native parsing layer is Firecrawl's open-source Rust engine. It classifies text-based, scanned, image-based, and mixed PDFs and extracts position-aware text, Markdown, layout signals, and native tables. Tuko runs that library inside its own endpoint and adds selective OCR, API validation, and table-response formatting; the document is not forwarded to Firecrawl's hosted API.

View the parser on GitHub →

That is useful, but the current public endpoint is a developer utility—not a managed enterprise outsourcing service. The distinction matters when deciding which business workflows should depend on it.

What the current endpoint provides

POST one PDF of up to 15 MB to https://www.tuko.my/api/v1/pdf/extract. The synchronous response can include document classification, layout warnings, selected-page Markdown or text, and OCR for up to five flagged pages. Use /api/v1/pdf/tables for separate native-text table headers and rows. For a small batch, send one request per PDF with controlled concurrency; the browser tool runs up to two requests at a time. No API key is currently required.

OpenAPI 3.0 and Swagger integration

Tuko publishes a machine-readable OpenAPI 3.0.3 document at /openapi.json. It describes both multipart endpoints, allowed values, response models, HTTP errors, and realistic examples. Use the interactive Swagger UI to inspect schemas or send a test request without writing code first.

Developers can import the JSON contract into tools that support OpenAPI 3.0 for client generation, API testing, request collections, or typed integration scaffolding. Generated code still needs application-level timeouts, validation, error handling, and human review because the contract describes the HTTP interface—not a service-level guarantee.

Realistic use cases for the current public API

Business use caseHow PDF Inspector helpsBusiness impact
PDF feature prototypeLets a product team test PDF-to-Markdown, OCR routing, or table extraction without first operating those dependencies.Validates customer demand before investing in a dedicated processing platform.
Human-reviewed back-office intakePre-fills text or native table rows from approved, low-volume documents for an employee to verify.Reduces rekeying while keeping a person responsible for the final record.
Document preflight and routingClassifies text, scanned, and mixed PDFs and reports columns, table pages, encoding issues, and OCR requirements.Avoids unnecessary OCR and routes difficult pages to specialist or human review.
Public manual knowledge-base pilotExtracts selected pages from public product manuals as Markdown and returns page-level diagnostics.Speeds a searchable-content pilot without building a parser service first.
Native-table automation proof of conceptReturns each detected table independently as headers, rows, Markdown, and CSV.Tests procurement or reporting automation without flattening unlike tables together.

Verify extracted values against the source PDF before making financial, legal, medical, or operational decisions.

Does this outsource PDF processing to Tuko?

Technically, yes. Your application sends the PDF to Tuko over HTTPS. Tuko's server runs the parser and optional OCR, then returns the result. Your application does not need to package the native PDF and OCR runtime itself.

Commercially and operationally, not yet. The public endpoint is not currently documented as a managed service with an SLA, reserved capacity, a DPA, supported API versions, incident commitments, or enterprise support.

Tuko handles for each request

  • PDF validation and temporary request processing
  • Native text and layout inspection
  • Selected-page Markdown or plain-text extraction
  • Up to five flagged English or Malay OCR pages
  • Native-text table detection and structured rows

The developer still owns

  • User authentication and upload authorization
  • Document classification, consent, and compliance approval
  • Timeouts, retries, rate control, and fallback behavior
  • Result validation, human review, and source traceability
  • Storage, deletion, monitoring, and downstream security

Where the current API fits—and where it does not

Reasonable fit today

  • Prototypes, demos, and proofs of concept
  • Low-volume internal workflows with human review
  • Public, synthetic, or explicitly approved documents
  • PDF preflight before another processing step
  • One-off selected-page or native-table extraction

Not a dependable fit today

  • High-volume batch or asynchronous processing
  • Workflows that require guaranteed uptime or latency
  • Regulated or confidential documents requiring a DPA
  • Multi-tenant products needing keys, quotas, and usage logs
  • Large files or OCR jobs beyond the published limits

Step-by-step API integration

1. Send a multipart PDF

The required form field is file. It must contain a valid PDF and be no larger than 15 MB. Password-protected, corrupted, or unsupported documents may return a processing error.

curl -X POST \
  -F "[email protected]" \
  -F "format=markdown" \
  https://www.tuko.my/api/v1/pdf/extract

2. Choose the format and page selection

Set format to markdown, text, or json. Markdown is the default. The HTTP response itself is JSON in every mode; the output object records the requested format and extracted content, while the other objects describe the document and processing result.

Add pages=1,3,5-8 to process only selected pages. Page numbers are 1-based, ranges are inclusive, and duplicates are removed.

3. Enable automatic OCR only when required

The default ocr=never inspects the text layer without recognizing page images. Set ocr=auto to recognize flagged pages and choose lang=eng, lang=msa, or lang=eng+msa. At most five flagged pages are processed per request.

curl -X POST \
  -F "[email protected]" \
  -F "format=markdown" \
  -F "pages=1-5" \
  -F "ocr=auto" \
  -F "lang=eng+msa" \
  https://www.tuko.my/api/v1/pdf/extract

4. Validate the response before using the text

The successful response contains five top-level fields:

  • success: confirms that the request completed.
  • document: filename, title, type, page count, confidence, and processing time.
  • layout: complex-layout status, table pages, column pages, and encoding issues.
  • ocr: required and processed status, page lists, language, results, failures, and skipped pages.
  • output: requested format and the extracted content.

Treat layout and OCR fields as validation signals. A successful HTTP response does not guarantee that an ambiguous two-column layout or low-quality scan was reconstructed perfectly.

5. Use the table endpoint for structured rows

The extraction endpoint is designed around the whole document. For native-text tables, POST the PDF and optional page selection to /api/v1/pdf/tables. Each detected table is returned independently with its source page, table index, headers, rows, Markdown, and CSV.

curl -X POST \
  -F "[email protected]" \
  -F "pages=2-6" \
  https://www.tuko.my/api/v1/pdf/tables

HTTP errors to handle

StatusMeaningClient action
400Missing field or invalid format, page selection, OCR mode, or languageCorrect the request parameters.
413PDF exceeds 15 MBCompress or split the source.
415Uploaded file is not a valid PDFCheck the file type and bytes.
422The PDF could not be processedCheck for encryption, corruption, or unsupported structure.

Operational and privacy considerations

An API call is a third-party document transfer. The implementation processes the request temporarily and does not intentionally save the PDF, but the public endpoint does not currently provide a contractual deletion guarantee, data-processing agreement, data-residency commitment, or service-level agreement. Do not send confidential, personal, regulated, medical, legal, or financial documents unless your organization has explicitly approved that processing arrangement.

For any integration, add request timeouts, validate file type and size before upload, control request rates, record failed and skipped page lists, retain source-page references, and require human verification where extraction errors could cause harm. A self-hosted pipeline or a documented managed provider is the safer choice when contractual controls are mandatory.

For a visual explanation of the document signals, read how to identify scanned and searchable PDFs. For workbook exports, see how separate Excel worksheets preserve table structure.

Test the extraction contract

Use Swagger UI to inspect the schemas and send a multipart request, or open PDF Inspector for the visual workflow.

Related guides

Keep going with nearby workflows that people usually need next.

Ready to try it?

Use our free PDF Inspector tool to get your task done instantly and securely.

Open PDF Inspector Tool

PDF Extraction API Guide: Use Cases, Limits, OCR & Tables FAQs

Common questions about using our PDF Extraction API Guide: Use Cases, Limits, OCR & Tables tool.

Does using the API mean Tuko processes my user's PDF?

Yes. The calling application uploads the PDF to Tuko for that request. Tuko runs the parser and optional OCR on the server, returns JSON, and does not intentionally persist the uploaded file in the current implementation.

Which PDF parser powers the Tuko API?

The current deployment uses @firecrawl/pdf-inspector version 1.12.0, Firecrawl's open-source Rust PDF Inspector engine. Tuko hosts the API and adds OCR routing and response handling; requests are not sent to Firecrawl's hosted API.

Does the PDF extraction API require an API key?

No API key is currently required. That makes testing easy, but it is not a capacity, availability, or long-term-access guarantee. Clients must use sensible request rates and handle service errors.

Is this a managed production document-processing service?

Not currently. The public endpoint has no documented API SLA, quota, version-support contract, DPA, webhook, asynchronous job system, or tenant-level usage controls. Treat it as a developer utility unless Tuko publishes a managed API offering.

Who is the current API most useful for?

It is most useful for prototypes, proofs of concept, low-volume internal workflows with human review, document preflight, and non-sensitive or explicitly approved PDFs within the published limits.

What is the maximum PDF upload size?

The current limit is 15 MB per request. Files above the limit return HTTP 413.

Can the API process multiple PDFs in one request?

No. Each API request accepts one PDF. For a small batch, send separate requests with controlled concurrency and handle each response independently. The PDF Inspector page does this for up to 10 files with two requests running at a time.

How do I select PDF pages through the API?

Add a pages form field using 1-based values such as 1,3,5-8. Invalid selections return HTTP 400.

How many pages can the API OCR automatically?

Automatic OCR processes up to five flagged pages per request. The response reports remaining, skipped, and failed pages so the client can decide what to do next.

What is the difference between the extraction and table endpoints?

The extraction endpoint returns document and layout metadata plus Markdown or text content. The table endpoint returns each detected native-text table as independent headers, rows, Markdown, and CSV data.

Are API uploads stored permanently?

The current implementation does not intentionally persist uploaded PDFs, but this is not a contractual retention or deletion guarantee. Do not send confidential, regulated, or personal documents unless your organization has approved the processing arrangement.