# Form to JSON API

> Filled form photo, scan or PDF to JSON: your fields or every field and checkbox. Handwriting OK.

**Stop retyping forms.** Send a **photo, scan or PDF** of a filled-in form, typed or **handwritten**, and get **JSON your code can store**: registration cards, claim forms, delivery notes, bills of lading, intake sheets, applications, questionnaires, certificates. Name the fields you want, or let the API find **every field, checkbox, table and signature** on its own. From **$0.0104 per page**: about **3x cheaper** than Google's form parser and **5x cheaper** than AWS Textract forms.

- Host: `form-to-json-handwritten-printed-form-ocr.p.rapidapi.com`
- Base URL: `https://form-to-json-handwritten-printed-form-ocr.p.rapidapi.com/v1/form-ocr`
- Auth: headers `X-RapidAPI-Key` and `X-RapidAPI-Host`
- OpenAPI: https://helenis-api.com/docs/form-ocr/openapi.json

## Endpoints

### Form Extraction

A form image or PDF to JSON: your fields, or every field found.

#### Extract Form from URL

`POST /v1/form-ocr/extract`

Read a filled-in form from its URL into JSON. A photo, scan or PDF of a filled-in form (typed or handwritten) as JSON. With `fields`: one typed value per field you name, checked against the page's own text. Without: every field (label and value), checkbox, option group, table and signature box. 1 credit per page (PDF: up to 10 pages).

| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
| `url` | body | `string` | yes | Direct link to a form: an image (PNG, JPEG, WEBP, HEIC, GIF, BMP, TIFF) or a PDF, up to 20 MB. | `https://upload.wikimedia.org/wikipedia/commons/a/aa/World_War_I_Draft_Registr...` |
| `fields` | body | `object[]` | no | The values you want, each with a name, a type and an optional short description of where it is on the form. Leave empty to get every field of the form (labels, values, checkboxes, tables, signatures). | `[{"name": "full_name", "type": "string"}, {"name": "date_of_birth", "type": "...` |
| `pages` | body | `string` | no | PDF only: pages to read, e.g. '1-2' or '1,3'. All when empty. | `1-2` |

```bash
curl -X POST "https://form-to-json-handwritten-printed-form-ocr.p.rapidapi.com/v1/form-ocr/extract" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: form-to-json-handwritten-printed-form-ocr.p.rapidapi.com" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://upload.wikimedia.org/wikipedia/commons/a/aa/World_War_I_Draft_Registration_Card_for_Louis_Armstrong_1918.gif",
    "fields": [
      {
        "name": "full_name",
        "type": "string"
      },
      {
        "name": "date_of_birth",
        "type": "date"
      },
      {
        "name": "race",
        "type": "string"
      },
      {
        "name": "employer",
        "type": "string"
      },
      {
        "name": "signed",
        "type": "boolean",
        "description": "is it signed"
      }
    ]
  }'
```

#### Extract Uploaded Form

`POST /v1/form-ocr/extract/upload`

Read an uploaded filled-in form into JSON. Same as /extract, for a file sent as multipart/form-data (field `file`; `fields` as a JSON array string).

| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
| `file` | form | `file` | yes | Form image or PDF, up to 20 MB. |  |
| `fields` | form | `string` | no | The values you want, each with a name, a type and an optional short description of where it is on the form. Leave empty to get every field of the form (labels, values, checkboxes, tables, signatures). Sent as a JSON array. |  |
| `pages` | form | `string` | no | PDF only: pages to read, e.g. '1-2' or '1,3'. All when empty. |  |

```bash
curl -X POST "https://form-to-json-handwritten-printed-form-ocr.p.rapidapi.com/v1/form-ocr/extract/upload" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: form-to-json-handwritten-printed-form-ocr.p.rapidapi.com" \
  -F "file=@./my-file"
```

## Sample call

Extract Form from URL: `POST /v1/form-ocr/extract`.

```bash
curl -X POST "https://form-to-json-handwritten-printed-form-ocr.p.rapidapi.com/v1/form-ocr/extract" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: form-to-json-handwritten-printed-form-ocr.p.rapidapi.com" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://upload.wikimedia.org/wikipedia/commons/a/aa/World_War_I_Draft_Registration_Card_for_Louis_Armstrong_1918.gif",
    "fields": [
      {
        "name": "full_name",
        "type": "string"
      },
      {
        "name": "date_of_birth",
        "type": "date"
      },
      {
        "name": "race",
        "type": "string"
      },
      {
        "name": "employer",
        "type": "string"
      },
      {
        "name": "signed",
        "type": "boolean",
        "description": "is it signed"
      }
    ]
  }'
```

## Response

```json
{
  "source": "https://upload.wikimedia.org/wikipedia/commons/a/aa/World_War_I_Draft_Registration_Card_for_Louis_Armstrong_1918.gif",
  "mime_type": "image/jpeg",
  "mode": "fields",
  "page_count": 1,
  "pages_read": [1],
  "title": "REGISTRATION CARD",
  "languages": ["en"],
  "handwriting": true,
  "data": {
    "full_name": "Lewis Armstrong",
    "date_of_birth": "1900-07-04",
    "race": "Negro",
    "employer": "Peter Lala",
    "signed": true
  },
  "fields": [
    { "name": "full_name", "type": "string", "value": "Lewis Armstrong", "page": 1, "handwritten": true, "confidence": "high" },
    { "name": "date_of_birth", "label": "Date of Birth", "type": "date", "value": "1900-07-04", "page": 1, "handwritten": true, "confidence": "high" },
    { "name": "race", "label": "Negro", "type": "string", "value": "Negro", "page": 1, "handwritten": true, "confidence": "high" },
    { "name": "employer", "label": "EMPLOYER'S NAME", "type": "string", "value": "Peter Lala", "page": 1, "handwritten": true, "confidence": "high" },
    { "name": "signed", "label": "REGISTRANT'S SIGNATURE OR MARK", "type": "boolean", "value": true, "page": 1, "handwritten": true, "confidence": "high" }
  ],
  "filled": 5,
  "empty": 0,
  "text": "REGISTRATION CARD\n\nSERIAL NUMBER\t928\tORDER NUMBER\t4177\n\n1. Lewis Armstrong\n(First name) (Middle name) (Last name)\n2. PERMANENT HOME ADDRESS: 1233 Perdido St. N.O. La.\n...",
  "truncated": false,
  "credits": 1
}
```

*From a real response on Louis Armstrong's 1918 draft registration card (U.S. National Archives, public domain), `text` shortened.* `data` is ready to store; `fields` adds the printed label, the page, handwriting and legibility of each value.

## Why developers pick this API

- 🛡️ **No invented values:** a value that is not on the form is `null`, never a guess. Text values are matched against an independent transcription of the page, so a field description cannot make the model write something else.
- 🧾 **Full text included:** in fields mode you also get the whole form as text, for search or audit, at no extra cost.
- 💸 **Priced per page, not per field:** about $0.0104 a page on PRO, where Google Document AI's Form Parser costs $0.03, AWS Textract forms $0.05 and other form APIs on RapidAPI $0.02 to $0.15. Failed calls (4xx, 5xx) use 0 credits.
- 🧰 **One call, any form:** no template to train, no zones to draw. A new form layout works on the first call.

## Auto mode: every field

Send no `fields` and the API lists everything the form asks for, filled or blank:

```json
{
  "mode": "auto",
  "title": "REGISTRATION CARD",
  "data": {
    "serial_number": "928",
    "name_first_name": "Lewis",
    "name_middle_name": null,
    "name_last_name": "Armstrong.",
    "permanent_home_address_street": "Perdido St.",
    "date_of_birth_month": "July",
    "race_white": false,
    "race_negro": true,
    "present_occupation": "Musician",
    "employers_name": "Peter Lala.",
    "nearest_relative_name": "Mary Armstrong, mother",
    "...": "..."
  },
  "fields": [
    { "name": "name_first_name", "label": "Name - First name", "type": "text", "value": "Lewis", "page": 1, "handwritten": true, "confidence": "high" },
    { "name": "race_negro", "label": "RACE - Negro", "type": "checkbox", "value": true, "page": 1, "handwritten": true, "confidence": "high" },
    { "...": "..." }
  ],
  "tables": [],
  "signatures": [{ "label": "(Registrant's signature or mark)", "signed": true, "page": 1 }],
  "filled": 25,
  "empty": 13,
  "credits": 1
}
```

*From a real response on the same card, shortened.* Auto values are strings as written (checkboxes are `true`/`false`, option groups give the chosen option); keys come from the printed labels and stay unique. Tables come back as `headers` and `rows`.

## How it works

1. **Download** (or upload) of the file; GIF, BMP, TIFF and very large images become JPEG; PDF pages are cut one by one.
2. **Read** at high resolution by a vision AI model, told to copy values exactly as written, never to infer or translate, and to mark unreadable words `[illegible]`.
3. **Check** (fields mode): a second reading, which never sees your field list, transcribes each page; every text value and label must be found in it (small handwriting differences allowed) or it is dropped. Values typed into fillable PDFs count as on the page.
4. **Type** the values: numbers without currency or separators, dates as `YYYY-MM-DD` read in the form's own day/month order, checkboxes as `true`/`false`.

## Privacy

Forms are downloaded, read and discarded: neither the file nor its content is stored by the API, and nothing is logged. The AI sub-processor may keep requests temporarily for abuse monitoring.

## Errors

```json
{ "error": { "status": 400, "code": "too_many_pages", "message": "At most 10 pages per call: choose them with 'pages'." } }
```

| Status | `code` | Meaning |
|---|---|---|
| 400 | `invalid_request` | Fix the input: field names (letters, digits, `_`), types, 40 fields at most. |
| 400 | `invalid_url`, `site_unreachable`, `site_blocked`, `file_too_large` | The file could not be downloaded (down, protected, over 20 MB). |
| 400 | `unsupported_file`, `pdf_encrypted` | Not an image or a PDF, or a password-protected PDF. |
| 400 | `too_many_pages`, `invalid_pages`, `plan_limit` | More than 10 pages, a bad `pages` range, or more than 1 page on the free plan. |
| 429 | `daily_limit_reached` | Daily safety limit of your plan; resets at 00:00 UTC. |
| 503 | `ai_error`, `capacity_exhausted` | Temporary failure. Retry. Not billed. |

## Limits

Very faded or cramped handwriting can be misread, like it would by a person: check `uncertain` and `confidence` and keep a human in the loop for those values. Dense tables of more than a few hundred cells may be cut (`truncated: true`). PDFs: 10 pages per call; password-protected PDFs are refused.

## Pricing

1 credit per page; very dense pages 2 or 3. Failed calls are never billed.

| Plan | Price | Credits included | Above the quota |
|---|---|---|---|
| BASIC | Free | 3 / day | resets every day |
| PRO | $4.99/month | 480 / month | $0.11 per credit |
| ULTRA | $14.99/month | 1,450 / month | $0.11 per credit |
| MEGA | $49.99/month | 4,800 / month | $0.11 per credit |

Apify actor **Form OCR to JSON - Handwritten & Printed Forms**: billed per event; free-plan users get 5 forms per run.

| Event | Charged for | Price |
|---|---|---|
| `form-page` | each page read (dense pages count 2 or 3) | $0.01 |

## Links

- API reference (HTML): https://helenis-api.com/docs/form-ocr
- OpenAPI: https://helenis-api.com/docs/form-ocr/openapi.json
- Overview and pricing: https://helenis-api.com/apis/form-ocr/
- RapidAPI listing: https://rapidapi.com/helenis-api-helenis-api-docs/api/form-to-json-handwritten-printed-form-ocr?utm_source=helenis&utm_medium=site&utm_campaign=form-ocr&utm_content=markdown
- Apify actor: https://apify.com/helenisapi/form-ocr-to-json-handwritten-printed-forms?utm_source=helenis&utm_medium=site&utm_campaign=form-ocr&utm_content=markdown
- MCP server (Apify): https://mcp.apify.com?tools=helenisapi/form-ocr-to-json-handwritten-printed-forms

MCP: Works in Claude, Cursor, VS Code and any MCP client; billed per event through Apify (your Apify token).

## Conventions (every Helenis API)

- Auth: two headers on every call, `X-RapidAPI-Key` (your key) and `X-RapidAPI-Host` (the API's host). One RapidAPI key works for every API you subscribe to.
- Billing in credits: one for a simple call, more for heavier work (a minute of audio, a page read by AI). Each API states its rule.
- Failed calls are never billed: a `4xx` bills zero credits and a `5xx` is never counted.
- Errors share one envelope: `{"error": {"status", "code", "message"}}` with a stable machine-readable `code`.
- `400`: fix the input (validation errors are always 400, never 422); not billed.
- `429`: rate limit; wait for `Retry-After`. `503`: temporary upstream or AI failure (`ai_error`, `upstream_timeout`); retry later, not billed.
- Values the source does not give come back as `null`, never invented.
