...

OCR API and SDK for document recognition

The NeuroVision document recognition API takes a photo or a scan, detects the document type on its own and returns JSON: fields, a confidence score for each field and the results of anti-fraud checks. Connect the REST API to your backend or the Web SDK to your website — in the cloud in Russia or inside your own perimeter.

OCR API: a photo of a document on a smartphone is sent for recognition
  • JSON with fields and a confidence score for each one
  • REST API and Web SDK for websites and mobile browsers
  • Cloud in Russia or Docker inside your perimeter
Data is stored in Russia Russian Software Registry No. 19972 152‑FZ

How the OCR API works: from image to JSON

One request, one response. Your backend does not need to pick the document type, cut out the fields or calculate checksums: the service does it. Need to match a face to a document or check liveness? These are other steps of the same API — KYC and Liveness.

Step 1

1. Get a token

A permanent token is created in the personal account under “Access”; a temporary one — with a request to POST /user/login. Pass the token in the header or as the token field in the request body.

Creating an OCR API access token in the NeuroVision personal account
Step 2

2. Send the images

POST /kyc/process accepts one or more images inmultipart/form-data: for example, a passport spread and the registration page. The mode is synchronous or asynchronous.

Sending document images to the OCR API in a single request
Step 3

3. The service recognizes the document

The neural network finds the document in the photo, detects the country and type, straightens the image, splits it into fields and reads each one. Anti-fraud checks run in parallel: editing, a photo of a screen, a printout.

The OCR API picks out the document fields and reads each of them
Step 4

4. Get the JSON

The response contains the document type, the country code, fields with confidence scores, check statuses and errors. In asynchronous mode the result arrives at your callback URL or on a status request.

OCR API response in JSON: document fields, confidence and checks

What the API returns: response fields and recognition confidence

Ordinary OCR returns a block of text, and your code has to parse it. The NeuroVision OCR API returns data that is already sorted out: each field with a name, a value and the model’s confidence score. Fields with high confidence can be written straight into a form, a CRM or a core banking system, and doubtful ones shown to the user or an operator. This is how the service works as an IDP system — read more on the page on document recognition.

  • Session and your system

    The outcome of the check and the link between the result and your user or application.

    Session status description

    Session outcome

    • status — idle, processing, success, failed, suspicious, exception, expired
    • sessionId — UUID v1 (timeuuid) of the session
    • spent — total processing time in seconds
    • isClientNew — the client’s first visit or a repeat one

    Link to your system

    • clientKey — the client key, up to 36 characters; used to look up a session
    • schemaId / scenarioId — the KYC schema (scenario) from the personal account
    • callback URL — a webhook with the final session result
  • The document and its fields

    The result for each image is a results[] element; only the set of document fields changes.

    Method description

    Document

    • type — document, selfie, faces
    • docName — the document type, for example Passport (2006)
    • countryCode — the country, ISO 3166-1 alpha-3 (RUS)
    • isBackSide — reverse side or not
    • tries — the number of recognition attempts

    Fields ocr.fields[]

    • title — the field name
    • value — the value
    • conf — the recognition confidence score
  • Checks and errors

    Why a session may fail even when the fields have been read.

    Error reference

    Anti-fraud checks[] (fraud)

    • isEdited — the document has not been edited
    • isDisplay — not photographed from a screen
    • isPrinted — the document is printed, not a photo of a screen
    • isXerocopy — not a photocopy
    • isMRZValid — the MRZ is valid
    • isFieldsModified, isStampsOk, isCropped and others — each check has status and caption

    Errors and objects

    • errors[] — for example [document] unknown document type
    • imageObjects[] — recognized objects: stamps, signatures

Which documents and files the OCR API accepts

The service detects the document type on its own. The integration needs just one thing — a legible image in the right format.

  • 16,000+ document types

    Passports, ID cards, driving licences and residence permits from 195+ countries and territories: Cyrillic, Latin and other scripts.

    The full list of documents
  • Multi-page documents

    A passport spread and the registration page can be sent in one request or in separate scenario steps: the service merges the data in one session.

    Passport recognition
  • Document type — automatic

    You do not need to specify the country or type: the model classifies the document from the image. For very similar documents the type can be set in the scenario.

  • Formats: JPEG and PNG

    The service accepts only JPEG and PNG. HEIC, WEBP and PDF are rejected with the error [general] bad image — convert them on your side before sending.

  • Image size and quality

    The face must be at least 30×30 pixels. No glare, heavy compression or cropped edges: the whole document must be in the frame.

    Why documents get re-shot
  • Scans and copies

    By default the anti-fraud flags printouts, photocopies and photos of a screen. If your process needs scans, these checks are switched off in the scenario editor.

Web SDK: a widget for capturing documents on websites and mobile browsers

The Web SDK is a ready-made JavaScript widget. It opens over your page, asks for camera access, guides the user on how to photograph the document and sends the images to the API itself: instructions → capture in a frame → quality check with a hint → completion. The outcome arrives as a webhook to your backend; the successCb callback on the front end fires only on a successful outcome.

The NeuroVision Web SDK in a mobile browser: a frame for capturing a document
Web SDK: a short instruction before capturing a document Web SDK: the “Document accepted” screen

Mobile app: WebView instead of a native SDK. There are no separate libraries for iOS and Android at the moment. The widget is responsive and works with a smartphone camera, so in a mobile app it is opened in an embedded browser or a WebView. One limitation: the browser blocks the camera inside a cross-origin iframe, so the widget cannot be embedded in someone else’s iframe.

clientKey is encrypted on your server with the scenario key (the documentation example is AES-256-CBC on Node.js) and only then passed to the browser: working with clientKey, widget parameters. Appearance: light or dark theme (theme), a “frosted glass” effect over the page (blurHost), embedding inside a block (mountElementId), callbacks successCb, closeCb, finalizedCb, a “sticky” 15-minute session (stickySession), language selection. Without an integration — a direct link to the widget or one-time KYC links from the personal account, up to 1,000 at a time.

Cloud document recognition or installation inside your perimeter: a comparison

  • Where it runs, launch and scaling

    Cloud — images are processed on NeuroVision servers in Russia, launch comes after a token is issued and a scenario is configured, and scaling is handled by NeuroVision. Inside your perimeter (on‑premises) — on your servers, with no calls to external services; NeuroVision engineers install the Docker containers on your servers; scaling — your servers, with two servers and a load balancer for production.

  • Internet and model updates

    Cloud — the internet is needed for API requests, and the models update automatically, without your involvement. Inside your perimeter — the internet is not needed to operate, only to activate the licence and for updates, which can be installed as offline packages; the models are updated by agreement: NeuroVision engineers connect over a secure channel and test after the update.

  • Payment and who it suits

    Cloud — payment for recognized documents or in packages; suits online services, fintech and marketplaces that need a quick launch. Inside your perimeter — a licence; suits banks, state-owned companies, healthcare and anyone with an isolated environment.

The core is the same — what changes is where the service runs and who maintains it. NeuroVision cloud OCR service suits a quick start; installation inside your perimeter — when documents must not leave the perimeter. The API functions are identical in both options: the same method, the same JSON.

OCR in Docker: server requirements and updates

  • Minimum configuration

    CPU with 16+ threads and AVX2 (AMD Ryzen 9 3900X or equivalent), NVIDIA RTX 3090 24 GB or equivalent (A5000, RTX 4080), 64 GB RAM, SSD from 1 TB.

  • Recommended

    CPU with 24+ threads (Intel Core i9-12900KF or equivalent), 2× RTX 3090 (48 GB) or equivalent (2× A5000, A6000, RTX 4090), 128 GB RAM, SSD/NVMe from 2 TB, network from 1 Gbit/s.

  • Installation and updates

    You prepare the servers and access over SSH or a secure channel; NeuroVision engineers install the containers and check that everything works. Updates are by agreement: a new version is switched on only after testing.

Images and results do not leave the perimeter.
The internet is needed only to activate the licence and for updates.

OCR API performance and limits

Figures from the NeuroVision documentation

Check them on your own documents and load. How to measure OCR quality — in an article on AI OCR accuracy

  • 01

    Processing time

    On production servers a full document check — upload, recognition, field extraction and checks — takes 500–600 ms on average, on the demo stand — up to 5 seconds. The actual session time is in the field spent.

  • 02

    Synchronous and asynchronous mode

    mode=sync — the result in the same HTTP response, convenient for a form. mode=async — returns sessionIdstraight away; the result comes as a webhook or on a request to POST /kyc/session/status. In the documentation examples the client timeout is 30 and 120 seconds.

  • 03

    Limits and packages

    The plan sets no request rate limits: a package can be used up in a day or in a year. When a package runs out the service is not blocked — you simply buy the next one. We discuss the load at the start of the trial.

  • 04

    How long data is stored

    Results are available by sessionId through the API and in the personal account; the retention period is set in the scenario. Original images are stored for 6 months and then deleted. Inside your perimeter you set the periods.

  • 500–600 ms a full document check in production
  • no limit on request rate under the plan
  • 6 months original images are stored

Authorization, versions and OCR API error codes

  • Permanent token Personal account → “Access” or /token/create
  • Temporary JWT POST /user/login, valid_days
  • How to pass the token the token header (JWT) or the token field in the body (permanent token)
  • Base address api.neuro-vision.ru/v1/
  • Without a token access denied (401)

  • [general] bad image  — the file sent is not an image convert to JPEG or PNG
  • [general] too small image  — the image is too small to recognize re-shoot without compression
  • [general] no documents on image  — no documents were found in the image check that the document is in the frame
  • [document] text fields not visible  — the fields are not visible ask for a re-shoot
  • [fraud] mobile device  — the photo was taken from a mobile device screen ask for a photo of the original
  • There are two kinds of error. A request error — HTTP 400 invalid schema (invalid parameters or no image), 401 access denied, 403 invalid user credentials. A recognition error arrives in an ordinary response: status: failed and the reason in results[].errors in the format [group] description.
  • failed does not always mean “could not read”: the fields may have been recognized, but the session will not pass because of low confidence or an anti-fraud check. Look at errors and checks in each element of results.
  • A full reference describing the technology behind each check — KYC errors.

Quick start: your first OCR API request in 5 steps

From request to your first JSON. A developer needs one evening; the rest are organizational steps on our side.

Step 1

1. Get trial access

Leave a request — a manager will give you access to the personal account. Trial access lasts 1 month.

OCR API trial access: a request and the personal account
Step 2

2. Create a token

In the personal account open the “Access” section (Access Tokens) and create a token (set an end date if needed). Store it as a secret.

Creating an access token in the “Access” section
Step 3

3. Set up a scenario

In the “KYC/AML” section create a scenario: which documents and countries to accept, which checks to enable, and the callback URL for webhooks. Copy its identifier.

Scenario setup: documents, checks, callback URL
Step 4

4. Send your first image

Run the request POST /kyc/process following the method documentation with your token and scenario. One photo of a document is enough for the first time. You can first see how it works in the demo.

The first OCR API request with a token and a scenario
Step 5

5. Parse the response and connect the webhook

Write the fields to your system and handle failed and low confidence. For production, enable asynchronous mode and a webhook with encryption.

Parsing the response and connecting a webhook

OCR API pricing and trial access

You pay only for recognized documents: per document or in packages, with no limits on the rate of use. The first month is a free trial.

Calculate the cost
  • 01

    Payment for recognized documents, per document or in packages

  • 02

    An annual package at a reduced price for large volumes

  • 03

    Installation inside your perimeter — under a licence

Licences and certificates

Innovation Promotion Foundation

The project «Development of a multimodal system using artificial intelligence "Neuromed" for managing the diagnostic processes of a clinic on the basis of the "Neurovision" computer vision platform» is supported by the Innovation Promotion Foundation within the federal project «Domestic Solutions»

Get trial access to the OCR API

Tell us which documents you need to recognize, in what volume and where the service should run — in the cloud or inside your perimeter. We will give you access to the personal account and help with your first request.

Can't put your request into words? Book a call and our team will contact you at a convenient time

Book a call

The company is included in the register of IT companies and the register of personal data operators of the Russian Ministry of Digital Development.

Address: Moscow, Presnenskaya Embankment 12 — Moscow City business centre, Federation Tower. Nearest metro stations: Delovoy Tsentr and Mezhdunarodnaya.

OCR API and SDK: frequently asked questions

Answers on methods, SDKs, Docker deployment, formats, speed, data and trial access

It is a REST API that takes an image of a document and returns the recognized fields in JSON. The service detects the country and document type on its own, reads the fields, checks the image for editing and for a photo of a screen, and gives a confidence score for each field.

POST /kyc/process at https://api.neuro-vision.ru/v1/. The request carries a token, one or more images in the images field and a scenario identifier. The status of an asynchronous session is requested with the POST /kyc/session/status method.

There are no separate server-side libraries: the API works over plain HTTP, so any language will do. The documentation has ready-made Python scripts.

There are no native SDKs for Android and iOS at the moment. The Web SDK works in mobile browsers and opens inside an app through a WebView, so document capture can be built into a mobile app too.

Yes. The service is installed inside your perimeter as a set of Docker containers, and NeuroVision engineers carry out installation and updates. After installation it works without the internet: access is needed only to activate the licence and for updates.

The minimum configuration from the documentation is a CPU with 16+ threads and AVX2, an NVIDIA RTX 3090 with 24 GB of video memory or equivalent, 64 GB RAM and an SSD from 1 TB. For production with a high SLA we recommend two servers with a load balancer.

Only JPEG and PNG. HEIC, WEBP and PDF files are rejected with the error [general] bad image, so they have to be converted before sending.

According to the documentation, on production servers a full document check takes 500–600 ms on average, on the demo stand — up to 5 seconds. The actual time of each session is returned in the spent field.

The plan sets no rate limits: a package can be used up at any pace, and when it runs out the service is not blocked. We discuss the expected load at the start of trial access.

In the cloud — on NeuroVision servers in Russia; with installation inside your perimeter — only on your servers. The retention period for results is set in the scenario, images are deleted after 6 months, and webhooks can be sent without personal data.

Yes, we give trial access for 1 month, with a personal account, a token and documentation. Leave a request at the bottom of the page.

Ordinary OCR returns a block of text, and you have to parse it. The NeuroVision OCR API returns fields with names and confidence scores, the document type and country, and the results of image anti-fraud checks.