← Voltar ao blog

OCR API for Brazilian documents: complete guide

Learn how to extract data from birth certificates with the DocsOCR API. Complete guide with code examples.

What is document OCR and why does it matter?

OCR (Optical Character Recognition) is the technology that transforms text in images — such as scanned documents, photos, and PDFs — into editable, searchable digital data. For Brazilian companies handling large volumes of documents, OCR is the difference between processing hundreds of documents per day or being stuck with manual data entry.

In Brazil, the digitization of processes has accelerated significantly. Registry offices, fintechs, law firms, and HR companies need to extract data from documents like birth certificates, national IDs, and driver’s licenses at scale. The problem? Most generic OCR solutions weren’t designed to handle the particularities of Brazilian documents.

How DocsOCR works

DocsOCR is a REST API specialized in Brazilian documents. Unlike generic solutions, our system was specifically trained on thousands of real documents from Brazil, resulting in significantly higher accuracy.

High availability architecture

The system uses two AI engines with automatic fallback:

  • Large (Accurate): Engine optimized for maximum precision in field extraction
  • Mini (Fast): Engine optimized for speed, used as automatic fallback

When the primary engine encounters difficulties with a specific document, the system automatically retries with the alternative engine. This ensures your documents are processed successfully, without any manual intervention.

Processing flow

  1. Upload: You send the document image via API (URL or Base64)
  2. Classification: The AI automatically identifies the document type
  3. Extraction: Relevant fields are extracted with real-time validation
  4. Response: Structured JSON is returned in 2-8 seconds

Supported documents

Currently, DocsOCR offers full extraction for Brazilian birth certificates, including:

  • Full name of the registered person
  • Date of birth
  • Place of birth (city and state)
  • Parents’ names
  • Registration and enrollment numbers
  • Issuing registry office name
  • Date of issuance
  • Supplementary data (grandparents, notes)

New document types are being added continuously. The automatic classification system already identifies various types, facilitating future expansion.

Getting started with the API

Getting started with DocsOCR is simple and takes less than 3 minutes:

1. Create your account

Access the admin panel and create a free account. You’ll receive welcome credits to test the API immediately — no credit card required.

2. Generate an API key

In the dashboard, navigate to the API keys section and generate your first key. Keep it in a safe place.

3. Make your first call

Here’s an example using Python:

import requests

url = "https://api.docsocr.com/api/v1/documents/process"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
    "imageUrl": "https://example.com/certificate.jpg"
}

response = requests.post(url, json=payload, headers=headers)
data = response.json()

print(data["data"]["documento"]["tipo"])
# "Certidão de Nascimento"

print(data["data"]["registrado"]["nome"])
# "João Silva Santos"

And using cURL:

curl -X POST https://api.docsocr.com/api/v1/documents/process \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"imageUrl": "https://example.com/certificate.jpg"}'

The response includes all extracted fields in structured JSON format, ready to be integrated into your system.

Accepted formats

DocsOCR accepts the following file formats:

  • PDF — digital or scanned documents
  • JPG/JPEG — photos and scans
  • PNG — images with or without transparency
  • HEIC — native iPhone camera format

The maximum file size is 10MB. You can send the document as a public URL or Base64-encoded content in the API request body.

Pricing and free credits

DocsOCR uses a pay-as-you-go credit model:

  • Each processed document consumes credits based on the contracted plan
  • New accounts receive free credits to test with real documents
  • No credit card required to get started
  • Monthly and annual plans available, with progressive volume discounts

The pay-as-you-go model ensures you only pay for what you use, with no high fixed costs or billing surprises.

Security and compliance

Data security is a top priority:

  • LGPD, GDPR, and CCPA: 100% compliant with major data protection regulations
  • Real-time processing: Documents are not stored after extraction
  • TLS encryption: All communication is encrypted in transit
  • Robust authentication: API keys with configurable scopes

Next steps

Ready to automate document processing in your company?

  1. Create your free account and receive welcome credits
  2. Explore the interactive documentation with examples in multiple languages
  3. Test with real documents using the free credits
  4. Integrate into your system and start scaling

DocsOCR was built for Brazilian companies that need OCR that simply works. No complex configuration, no lengthy integration projects — just a simple API that transforms documents into structured data.