Creates an instance of FormRecognizerClient.
Example usage:
import { FormRecognizerClient, AzureKeyCredential } from "@azure/ai-form-recognizer";
const client = new FormRecognizerClient(
"<service endpoint>",
new AzureKeyCredential("<api key>")
);
Url to an Azure Form Recognizer service endpoint
Used to authenticate requests to the service.
Used to configure the Form Recognizer client.
URL to an Azure Form Recognizer service endpoint
Recognizes data from business cards using a pre-built business card model, enabling you to extract structured data from business cards such as name, job title, phone numbers, etc.
For a list of fields that are contained in the response, please refer to the documentation at the following link: https://aka.ms/formrecognizer/businesscardfields
This method returns a long running operation poller that allows you to wait indefinitely until the operation is completed.
Note that the onProgress callback will not be invoked if the operation completes in the first request, and attempting to cancel a completed copy will result in an error being thrown.
Example usage:
const path = "./business-card-english.png";
const readStream = fs.createReadStream(path);
const client = new FormRecognizerClient(endpoint, new AzureKeyCredential(apiKey));
const poller = await client.beginRecognizeBusinessCards(readStream, {
contentType: "image/png",
onProgress: (state) => { console.log(`status: ${state.status}`); }
});
const [businessCard] = await poller.pollUntilDone();
Recognizes business card information from a given document
Input document
Options for the recognition operation
Recognizes business card information from a url using a pre-built business card model, enabling you to extract structured data from business cards such as name, job title, phone numbers, etc.
For a list of fields that are contained in the response, please refer to the documentation at the following link: https://aka.ms/formrecognizer/businesscardfields
This method returns a long running operation poller that allows you to wait indefinitely until the operation is completed.
Note that the onProgress callback will not be invoked if the operation completes in the first request, and attempting to cancel a completed copy will result in an error being thrown.
Example usage:
const url = "<url to the business card document>";
const client = new FormRecognizerClient(endpoint, new AzureKeyCredential(apiKey));
const poller = await client.beginRecognizeBusinessCardsFromUrl(url, {
includeFieldElements: true,
onProgress: (state) => {
console.log(`analyzing status: ${state.status}`);
}
});
const [businessCard] = await poller.pollUntilDone();
Recognizes business card information from a given accessible url to a document
Url to a business card document that is accessible from the service. Must be a valid, encoded URL to a document of a supported content type.
Options for the recognition operation
Recognizes content, including text and table structure from a form document.
This method returns a long running operation poller that allows you to wait indefinitely until the operation is completed. Note that the onProgress callback will not be invoked if the operation completes in the first request, and attempting to cancel a completed copy will result in an error being thrown.
Example usage:
const path = "./Invoice_7.pdf";
const readStream = fs.createReadStream(path);
const client = new FormRecognizerClient(endpoint, new AzureKeyCredential(apiKey));
const poller = await client.beginRecognizeContent(readStream, "application/pdf", {
onProgress: (state) => { console.log(`status: ${state.status}`); }
});
const pages = await poller.pollUntilDone();
Recognizes content/layout information from a given document
Input document
Options to start content recognition operation
Recognizes content, including text and table structure from a url to a form document.
This method returns a long running operation poller that allows you to wait indefinitely until the operation is completed. Note that the onProgress callback will not be invoked if the operation completes in the first request, and attempting to cancel a completed copy will result in an error being thrown.
Example usage:
const url = "<form document url>";
const client = new FormRecognizerClient(endpoint, new AzureKeyCredential(apiKey));
const poller = await client.beginRecognizeContentFromUrl(url, {
onProgress: (state) => { console.log(`status: ${state.status}`); }
});
const pages = await poller.pollUntilDone();
Recognizes content/layout information from a url to a form document
Url to a document that is accessible from the service. Must be a valid, encoded URL to a document of a supported content type.
Options for the content recognition operation
Recognizes forms from a given document using a custom form model from training.
This method returns a long running operation poller that allows you to wait indefinitely until the operation is completed.
Note that the onProgress callback will not be invoked if the operation completes in the first request, and attempting to cancel a completed copy will result in an error being thrown.
Example usage:
const path = "./Invoice_6.pdf";
const readStream = fs.createReadStream(path);
const client = new FormRecognizerClient(endpoint, new AzureKeyCredential(apiKey));
const poller = await client.beginRecognizeCustomForms(modelId, readStream, "application/pdf", {
onProgress: (state) => { console.log(`status: ${state.status}`); }
});
const forms = await poller.pollUntilDone();
Recognizes form information from a given document using a custom form model.
Id of the custom form model to use
Input form document
Options to start the form recognition operation
Recognizes forms from a URL to a document using a custom form model from training.
This method returns a long running operation poller that allows you to wait indefinitely until the operation is completed.
Note that the onProgress callback will not be invoked if the operation completes in the first request, and attempting to cancel a completed copy will result in an error being thrown.
Example usage:
const url = "<form document url>";
const client = new FormRecognizerClient(endpoint, new AzureKeyCredential(apiKey));
const poller = await client.beginRecognizeCustomFormsFromUrl(modelId, url, {
onProgress: (state) => { console.log(`status: ${state.status}`); }
});
const forms = await poller.pollUntilDone();
Recognizes form information from a url to a document using a custom form model.
Id of the custom form model to use
Url to a document that is accessible from the service. Must be a valid, encoded URL to a document of a supported content type.
Options for the recognition operation
Recognizes data from identification documents using a pre-built ID document model, enabling you to extract structured data from ID documents such as first/last name, document number, expiration date, and more.
For a list of fields that are contained in the response, please refer to the documentation at the following link: https://aka.ms/formrecognizer/iddocumentfields
This method returns a long running operation poller that allows you to wait indefinitely until the operation is completed.
Note that the onProgress callback will not be invoked if the operation completes in the first request, and attempting to cancel a completed copy will result in an error being thrown.
Example usage:
const path = "./license.jpg";
const readStream = fs.createReadStream(path);
const client = new FormRecognizerClient(endpoint, new AzureKeyCredential(apiKey));
const poller = await client.beginRecognizeIdentityDocuments(readStream, {
onProgress: (state) => { console.log(`status: ${state.status}`); }
});
const [identityDocument] = await poller.pollUntilDone();
Input document
Options for the recognition operation
Recognizes identity document information from a url using pre-built ID document model, enabling you to extract structured data from ID documents such as first/last name, document number, expiration date, and more.
For a list of fields that are contained in the response, please refer to the documentation at the following link: https://aka.ms/formrecognizer/iddocumentfields
This method returns a long running operation poller that allows you to wait indefinitely until the operation is completed.
Note that the onProgress callback will not be invoked if the operation completes in the first request, and attempting to cancel a completed copy will result in an error being thrown.
Example usage:
const url = "<url to the identity document>";
const client = new FormRecognizerClient(endpoint, new AzureKeyCredential(apiKey));
const poller = await client.beginRecognizeIdentityDocumentsFromUrl(url, {
includeFieldElements: true,
onProgress: (state) => {
console.log(`analyzing status: ${state.status}`);
}
});
const [identityDocument] = await poller.pollUntilDone();
Url to an identity document that is accessible from the service. Must be a valid, encoded URL to a document of a supported content type.
Options for the recognition operation
Recognizes data from invoices using a pre-built invoice model, enabling you to extract structured data from invoices such as customer address, vendor address, purchase order ID, etc.
For a list of fields that are contained in the response, please refer to the documentation at the following link: https://aka.ms/formrecognizer/invoicefields
This method returns a long running operation poller that allows you to wait indefinitely until the operation is completed.
Note that the onProgress callback will not be invoked if the operation completes in the first request, and attempting to cancel a completed copy will result in an error being thrown.
Example usage:
const path = "./Invoice_1.pdf";
const readStream = fs.createReadStream(path);
const client = new FormRecognizerClient(endpoint, new AzureKeyCredential(apiKey));
const poller = await client.beginRecognizeInvoices(readStream, {
contentType: "application/pdf",
onProgress: (state) => { console.log(`status: ${state.status}`); }
});
const [invoice] = await poller.pollUntilDone();
Recognizes invoice information from a given document
Input document
Options for the recognition operation
Recognizes invoice information from a URL using a pre-built invoice model, enabling you to extract structured data from invoices such as customer address, vendor address, purchase order ID, etc.
For a list of fields that are contained in the response, please refer to the documentation at the following link: https://aka.ms/formrecognizer/invoicefields
This method returns a long running operation poller that allows you to wait indefinitely until the operation is completed.
Note that the onProgress callback will not be invoked if the operation completes in the first request, and attempting to cancel a completed copy will result in an error being thrown.
Example usage:
const url = "<url to the invoice document>";
const client = new FormRecognizerClient(endpoint, new AzureKeyCredential(apiKey));
const poller = await client.beginRecognizeInvoicesFromUrl(url, {
includeFieldElements: true,
onProgress: (state) => {
console.log(`analyzing status: ${state.status}`);
}
});
const [invoice] = await poller.pollUntilDone();
Recognizes invoice information from a given accessible url to a document
Url to an invoice document that is accessible from the service. Must be a valid, encoded URL to a document of a supported content type.
Options for the recognition operation
Recognizes data from receipts using a pre-built receipt model, enabling you to extract structured data from receipts such as merchant name, merchant phone number, transaction date, and more.
For a list of fields that are contained in the response, please refer to the documentation at the following link: https://aka.ms/formrecognizer/receiptfields
This method returns a long running operation poller that allows you to wait indefinitely until the operation is completed.
Note that the onProgress callback will not be invoked if the operation completes in the first request, and attempting to cancel a completed copy will result in an error being thrown.
Example usage:
const path = "./contoso-allinone.jpg";
const readStream = fs.createReadStream(path);
const client = new FormRecognizerClient(endpoint, new AzureKeyCredential(apiKey));
const poller = await client.beginRecognizeReceipts(readStream, {
contentType: "image/jpeg",
onProgress: (state) => { console.log(`status: ${state.status}`); }
});
const [receipt] = await poller.pollUntilDone();
Recognizes receipt information from a given document
Input document
Options for the recognition operation
Recognizes receipt information from a url using pre-built receipt model, enabling you to extract structure data from receipts such as merchant name, merchant phone number, transaction date, and more.
For a list of fields that are contained in the response, please refer to the documentation at the following link: https://aka.ms/formrecognizer/receiptfields
This method returns a long running operation poller that allows you to wait indefinitely until the operation is completed.
Note that the onProgress callback will not be invoked if the operation completes in the first request, and attempting to cancel a completed copy will result in an error being thrown.
Example usage:
const url = "<url to the receipt document>";
const client = new FormRecognizerClient(endpoint, new AzureKeyCredential(apiKey));
const poller = await client.beginRecognizeReceiptsFromUrl(url, {
includeFieldElements: true,
onProgress: (state) => {
console.log(`analyzing status: ${state.status}`);
}
});
const [receipt] = await poller.pollUntilDone();
Recognizes receipt information from a given accessible url to a document
Url to a receipt document that is accessible from the service. Must be a valid, encoded URL to a document of a supported content type.
Options for the recognition operation
Generated using TypeDoc
Client class for interacting with the Azure Form Recognizer service.