FormRead Server-Side Processing API

Server-Side Form Processing

The FormRead Server-Side API lets you send a scanned form image and receive structured results (OMR, OCR, BCR) directly as JSON. No browser, no iframe — just a simple HTTP request from your backend to ours.

  • Send an image, get results back as JSON in a single request
  • Supports OMR (bubble detection), OCR (text extraction), and BCR (barcode/QR reading)
  • Form configuration is loaded automatically from the form you set up in the dashboard
When to Use This API

Use the server-side API when you need automated, server-to-server processing without any user interface — for example, processing batches of scanned forms from a folder, integrating with your existing backend pipeline, or building automated grading systems.

If you need a visual interface where users can set up forms, review results, and do QA — use the Iframe Integration API instead.

Autenticação

Para usos corporativos, a API pode ser usada gerando um token Bearer Auth.

Faça login no FormRead painel e acesse a opção API Token:

FormRead dashboard menu with the API Tokens option highlighted

Crie os tokens de API para permitir que serviços de terceiros se autentiquem com nosso aplicativo em seu nome:

Creating a new FormRead API token with permission checkboxes

Process a Form Image

Send a scanned form image to be processed. The form must already be set up with read areas (OMR, OCR, BCR) via the dashboard or iframe. The API uses the saved form configuration to process the image.

POST /api/forms/{form_id}/process

Headers

Name Value
Authorization Bearer YOUR_API_TOKEN
Accept application/json
Content-Type application/json or multipart/form-data

With file upload:

curl --location 'https://formread.org/api/forms/123/process' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_TOKEN' \
  --form 'image=@"/path/to/scanned-form.jpg"'

With image URL:

curl --location 'https://formread.org/api/forms/123/process' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"image_url": "https://example.com/scanned-form.jpg"}'

Response

{
  "success": true,
  "results": {
    "OMR-0-0": "A",
    "OMR-0-1": "C",
    "OMR-0-2": "B,D",
    "OCR-1": "John Smith",
    "BCR-2": "1234567890"
  },
  "omr_details": {
    "OMR-0": {
      "questions": [
        [
          {"left": 0.12, "top": 0.22, "width": 0.02, "height": 0.02, "blackPixelsRatio": 0.72},
          {"left": 0.15, "top": 0.22, "width": 0.02, "height": 0.02, "blackPixelsRatio": 0.15}
        ]
      ]
    }
  },
  "anchor_error": false,
  "processing_time_ms": 450
}

Response Fields

Field Type Descrição
success boolean Whether the processing completed successfully
results object Key-value pairs of area results. Keys are area names (e.g., OMR-0-0, OCR-1, BCR-2)
omr_details object Detailed bubble-level data for OMR areas including positions and fill ratios
anchor_error boolean True if the form sheet could not be aligned (e.g., corners not detected)
processing_time_ms integer Processing time in milliseconds

Image Input Options

You can provide the image in three ways. Use exactly one:

Parâmetro Type Descrição
image file File upload (multipart/form-data)
image_url string Public URL to the image
image_base64 string Base64-encoded image data
Note

The form configuration (read areas, thresholds, anchors) is automatically loaded from the form you set up in the FormRead dashboard. You do not need to send any configuration in the request.

Batch Processing

To process multiple images of the same form in one request, pass a comma-separated list of URLs in the image_url field. Results are returned as an array in the same order.

Request

curl --location 'https://formread.org/api/forms/123/process' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"image_url": "https://example.com/a.jpg,https://example.com/b.jpg,https://example.com/c.jpg"}'

Response

{
  "results": [
    {
      "id": "0",
      "image_url": "https://example.com/a.jpg",
      "success": true,
      "results": { "OMR-0-0": "A", "OCR-1": "John Smith" },
      "anchor_error": false,
      "processing_time_ms": 430
    },
    {
      "id": "1",
      "image_url": "https://example.com/b.jpg",
      "success": true,
      "results": { "OMR-0-0": "B", "OCR-1": "Jane Doe" }
    },
    {
      "id": "2",
      "image_url": "https://example.com/c.jpg",
      "success": false,
      "error": "Failed to fetch image from URL: 404"
    }
  ],
  "total": 3
}

Batch Parameters

Parameter Type Default Description
image_url string One or more public image URLs. Comma-separated for batch mode.
details boolean false Include omr_details (per-bubble positions and fill ratios) in each batch result. Omitted by default to keep responses small.
Batch behavior
  • Batch mode is only available with image_url. File uploads and image_base64 are single-image only.
  • A failed URL does not fail the whole batch — that item gets "success": false and an error field; the rest continue.
  • Results preserve the submitted order via id (0-indexed).
  • omr_details is always returned in single-image mode; in batch mode it requires "details": true.

Batch with omr_details

curl --location 'https://formread.org/api/forms/123/process' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "image_url": "https://example.com/a.jpg,https://example.com/b.jpg",
    "details": true
  }'

Limits

Limit Value Behavior
Requests per minute 60 Per API token. Exceeding returns HTTP 429.
Per-request timeout 60s Requests exceeding 60 seconds are terminated with an error.

A 429 response looks like this:

{
  "message": "Too Many Attempts."
}

A batched request counts as one call regardless of how many URLs it contains.

Sizing batches
  • Per batch: measure processing_time_ms on a sample single-image response, then pack a batch that comfortably finishes under 60 seconds.
  • Across batches: pace requests so you stay under 60 per minute.
  • Image size: downsize client-side to the smallest dimensions that still yield correct results. This is the biggest lever on per-image time.

Supported Area Types

Type Descrição Result Format
OMR Optical Mark Recognition — detects filled bubbles on answer sheets "A", "B,C"
OCR Optical Character Recognition — extracts printed or handwritten text "John Smith"
BCR Barcode/QR Code Recognition — reads barcodes and QR codes "1234567890"

Code Examples

Here are complete examples in Python and JavaScript for processing a form image:

Python

import requests

API_URL = "https://formread.org/api/forms/{form_id}/process"
TOKEN = "YOUR_API_TOKEN"

with open("scanned-form.jpg", "rb") as f:
    response = requests.post(
        API_URL.format(form_id=123),
        headers={
            "Accept": "application/json",
            "Authorization": f"Bearer {TOKEN}",
        },
        files={"image": f},
    )

data = response.json()
print(data["results"])
# {"OMR-0-0": "A", "OMR-0-1": "C", "OCR-1": "John Smith"}

Node.js

const FormData = require('form-data');
const fs = require('fs');
const axios = require('axios');

const form = new FormData();
form.append('image', fs.createReadStream('scanned-form.jpg'));

const response = await axios.post(
  'https://formread.org/api/forms/123/process',
  form,
  {
    headers: {
      ...form.getHeaders(),
      'Accept': 'application/json',
      'Authorization': 'Bearer YOUR_API_TOKEN',
    },
  }
);

console.log(response.data.results);
// { 'OMR-0-0': 'A', 'OMR-0-1': 'C', 'OCR-1': 'John Smith' }

Perguntas frequentes

O que faz a API de processamento do lado do servidor?

Você envia uma imagem de formulário digitalizada com um único HTTP POST e recebe resultados estruturados OMR (bolhas), OCR (texto) e BCR (códigos de barras/QR) em JSON — sem navegador nem iframe.

Como autentico as requisições?

Envie seu token de acesso pessoal como token Bearer no header Authorization: Authorization: Bearer SEU_TOKEN_API. Gere o token na seção de tokens de API do seu painel do FormRead.

Posso processar várias imagens numa mesma requisição?

Sim. Passe uma lista de URLs públicas separadas por vírgula no campo image_url. Os resultados voltam num array respeitando a ordem de envio, e uma URL que falha só afeta seu próprio item — as demais continuam.

Quais são os limites de taxa e tamanho?

Até 60 requisições por minuto por token de API, com um timeout de 60 segundos por requisição. Uma requisição em lote conta como uma única chamada, independentemente de quantas URLs contenha.

Preciso enviar a configuração do formulário em toda requisição?

Não. A configuração do formulário — áreas de leitura, limiares e âncoras — é carregada automaticamente a partir do formulário configurado no painel do FormRead. Sua requisição só precisa da imagem e do id do formulário na URL.

Pronto para Experimentar o FormRead?

Crie, leia e processe formulários OMR com facilidade. Comece a extrair dados de seus formulários hoje mesmo!

Nenhum cartão de crédito necessário para começar