OCR & Text Extraction

The Best Free Tools for Scanned Document To Text

ZeroPhantom Team 2025-08-31 2 min read

This guide shows you how to integrate scanned document to text via API — with working code examples in Python and JavaScript. Whether you're building an internal tool or a customer-facing product, the ZeroPhantom API gives you a production-ready endpoint in minutes.

Why Use an API for Scanned Document To Text?

Manual processes don't scale. Once you're handling more than a few dozen operations per day, you need automation. ZeroPhantom charges just $0.0020 per API call — up to 40× cheaper than CloudConvert. The API approach also means you can build scanned document to text directly into your existing workflows, dashboards, and CI/CD pipelines.

Authentication

All API requests require an API key passed in the X-API-Key header. Get yours at ZeroPhantom Credits — credits start from $5 and never expire.

Python Example

import requests

# ZeroPhantom API — scanned document to text
api_url = "https://api.zphantom.com/v1/process"
headers = {"X-API-Key": "your_api_key_here"}

response = requests.post(api_url, headers=headers, data={
    "type": "scanned_document_to_text",
    "input": "your_input_here"
})

result = response.json()
print(result["output"])

JavaScript / Node.js Example

const fetch = require('node-fetch');

const response = await fetch('https://api.zphantom.com/v1/process', {
  method: 'POST',
  headers: {
    'X-API-Key': 'your_api_key_here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    type: 'scanned_document_to_text',
    input: 'your_input_here'
  })
});

const result = await response.json();
console.log(result.output);

API Response Structure

{"status": "success", "output": "...", "credits_used": 1, "credits_remaining": 4999}

Rate Limits and Credits

  • Each API call costs 1 credit ($0.0020 on Starter plan)
  • Temp Mail API calls are always free
  • Rate limit: 60 requests/minute on all plans
  • Credits never expire — buy once, use when ready
💡 Pro Tip: Use batch endpoints when processing multiple items — they reduce API call overhead by up to 80%.

Error Handling

{"status": "error", "code": "INSUFFICIENT_CREDITS", "message": "Top up at zphantom.com/buy-credits"}

Common error codes:

  • INVALID_KEY — check your API key in your portal
  • INSUFFICIENT_CREDITS — top up at ZeroPhantom Credits
  • RATE_LIMITED — back off for 60 seconds and retry
  • INVALID_INPUT — check the input format in ZeroPhantom API Docs

Full API Documentation

See the ZeroPhantom API Docs for the complete endpoint reference, input formats, and response schemas for all supported operations.

Try it free: ZeroPhantom OCR Tool — no signup, no KYC. See ZeroPhantom API Docs for full pricing.