US W9 OCR Node.js

The Node.js OCR SDK supports the US W9 API.

Using the sample below, we are going to illustrate how to extract the data that we want using the OCR SDK.
US W9 sample


const mindee = require("mindee");
// for TS or modules:
// import * as mindee from "mindee";

// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });

// Load a file from disk
const inputSource = mindeeClient.docFromPath("/path/to/the/file.ext");

// Parse the file
const apiResponse = mindeeClient.parse(,

// Handle the response Promise
apiResponse.then((resp) => {
  // print a string summary

Output (RST):

Field Types

Standard Fields

These fields are generic and used in several products.

Basic Field

Each prediction object contains a set of fields that inherit from the generic Field class.
A typical Field object will have the following attributes:

  • value (number|string): corresponds to the field value. Can be undefined if no value was extracted.
  • confidence (number): the confidence score of the field prediction.
  • boundingBox ([Point, Point, Point, Point]): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
  • polygon (Point[]): contains the relative vertices coordinates (Point) of a polygon containing the field in the image.
  • pageId (number): the ID of the page, is undefined when at document-level.
  • reconstructed (boolean): indicates whether or not an object was reconstructed (not extracted as the API gave it).

Note: A Point simply refers to an array of two numbers ([number, number]).

Aside from the previous attributes, all basic fields have access to a toString() method that can be used to print their value as a string.

Position Field

The position field PositionField does not implement all the basic Field attributes, only boundingBox, polygon and pageId. On top of these, it has access to:

  • rectangle ([Point, Point, Point, Point]): a Polygon with four points that may be oriented (even beyond canvas).
  • quadrangle ([Point, Point, Point, Point]): a free polygon made up of four points.

String Field

The text field StringField only has one constraint: its value is a string (or undefined).

Page-Level Fields

Some fields are constrained to the page level, and so will not be retrievable to through the document.


The following fields are extracted for US W9 V1:


📄address (StringField): The street address (number, street, and apt. or suite no.) of the applicant.

for (const addressElem of result.document.address) {

Business Name

📄businessName (StringField): The business name or disregarded entity name, if different from Name.

for (const businessNameElem of result.document.businessName) {

City State Zip

📄cityStateZip (StringField): The city, state, and ZIP code of the applicant.

for (const cityStateZipElem of result.document.cityStateZip) {


📄ein (StringField): The employer identification number.

for (const einElem of result.document.ein) {


📄name (StringField): Name as shown on the applicant's income tax return.

for (const nameElem of {

Signature Date Position

📄signatureDatePosition (PositionField): Position of the signature date on the document.

for (const signatureDatePositionElem of result.document.signatureDatePosition) {

Signature Position

📄signaturePosition (PositionField): Position of the signature on the document.

for (const signaturePositionElem of result.document.signaturePosition) {


📄ssn (StringField): The applicant's social security number.

for (const ssnElem of result.document.ssn) {

Tax Classification

📄taxClassification (StringField): The federal tax classification, which can vary depending on the revision date.

for (const taxClassificationElem of result.document.taxClassification) {

Tax Classification LLC

📄taxClassificationLlc (StringField): Depending on revision year, among S, C, P or D for Limited Liability Company Classification.

for (const taxClassificationLlcElem of result.document.taxClassificationLlc) {

Tax Classification Other Details

📄taxClassificationOtherDetails (StringField): Tax Classification Other Details.

for (const taxClassificationOtherDetailsElem of result.document.taxClassificationOtherDetails) {

W9 Revision Date

📄w9RevisionDate (StringField): The Revision month and year of the W9 form.

for (const w9RevisionDateElem of result.document.w9RevisionDate) {


Join our Slack