action cloudmersive_image_ocr_photo_recognize_form { label: "Recognize a photo of a form, extract key fields and business information" description: "Analyzes a photograph of a form as input, and outputs key business fields and information. Customzie data to be extracted by defining fields for the form. Note: for free tier API keys, it is required to add a credit card to your account for security reasons, to use the free tier key with this API." provider: cloudmersive method: POST path: "/ocr/photo/recognize/form" encoding: json input: { type: "object" properties: { diagnostics: { type: "string" } formTemplateDefinition: { type: "object" description: "Definition of a form template; use a form template definition to recognize the fields in a form with Cloudmersive OCR" properties: { FieldDefinitions: { type: "array" description: "Field definitions in the template; a field is comprised of a key/value pair" items: { type: "object" description: "Definition of a form field for OCR data extraction from images" properties: { AllowNumericDigits: { type: "boolean" description: "Optional - set to false to block values that contain numeric digits, set to true to allow numeric digits" } AlternateAnchor: { type: "string" description: "Optional - alterate match text for the specified anchor" } AnchorMode: { type: "string" description: "Optional - the matching mode for the anchor. Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match) and Horizontal (anchor must be laid out horizontally). Default is Partial." } BottomAnchor: { type: "string" description: "Optional - the bottom anchor of the field" } DataType: { type: "string" description: "The data type of the field; possible values are INTEGER (Integer value), STRING (Arbitrary string value, spaces are permitted), DATE (Date in a structured format), DECIMAL (Decimal number), ALPHANUMERIC (Continuous alphanumeric string with no spaces), STRINGNOWHITESPACE (A string that contains no whitespace characters), SERIALNUMBER (A serial-number style string that contains letters and numbers, and certain symbols; must contain at least one number), ALPHAONLY (Alphabet characters only, no numbers or symbols or whitespace)" } FieldID: { type: "string" description: "The identifier of the field; use this to identify which field is being referenced. Set to SkipField if you do not wish to return the value of this field in the result." } HorizontalAlignmentType: { type: "string" description: "Horizontal alignment of target value area relative to the field anchor; Possible values are Left, Right" } Ignore: { type: "array" description: "Optional - Ignore any result items that contain a partial or complete match with these text strings" items: { type: "string" } } LeftAnchor: { type: "string" description: "Optional - the left-hand anchor of the field" } MinimumCharacterCount: { type: "integer" format: "int32" description: "Optional - the target number of digits in the field; useful for fixed-length fields" } Options: { type: "string" description: "Optional - additional options that can be set for this field definition, separated by commas. Possible values are AllowMultiMatch (allow the same anchor to be matched to multiple fields)" } TargetDigitCount: { type: "integer" format: "int32" description: "Optional - the target number of digits in the field; useful for fixed-length fields" } TargetFieldHeight_Relative: { type: "number" format: "double" description: "Optional - scale factor for target field height - relative to height of field title" } TargetFieldHorizontalAdjustment: { type: "number" format: "double" description: "Optional - horizontal adjestment in relative width of the field" } TargetFieldVerticalAdjustment: { type: "number" format: "double" description: "Optional - vertical adjestment in relative height of the field" } TargetFieldWidth_Relative: { type: "number" format: "double" description: "Optional - scale factor for target field width - relative to width of field title; a value of 1.0 indicates the target value area has the same width as the field value as occurring in the image; a value of 2.0 would indicate that the target value area has 2 times the width of the field value as occurring in the image." } TopAnchor: { type: "string" description: "Optional - the top anchor of the field" } VerticalAlignmentType: { type: "string" description: "Vertical alignment of target value area relative to the field anchor; Possible values are VCenter, Top, Bottom" } } } } TableDefinitions: { type: "array" description: "Table definitions in the template; a table is comprised of columns and rows and exists in a 2-dimensional layout; a common example of a table would be an invoice" items: { type: "object" description: "Definition of a form table for OCR data extraction from images" properties: { ColumnDefinitions: { type: "array" description: "Definition of the columns in the table" items: { type: "object" description: "Definition of a column within a table for OCR data extraction from images" properties: { AllowNumericDigits: { type: "boolean" description: "Optional - set to false to block values that contain numeric digits, set to true to allow numeric digits" } AnchorMode: { type: "string" description: "Optional - the matching mode for the anchor. Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match). Default is Partial." } ColumnID: { type: "string" description: "The identifier of the field; use this to identify which field is being referenced" } DataType: { type: "string" description: "The data type of the field; possible values are INTEGER (Integer value), STRING (Arbitrary string value, spaces are permitted), DATE (Date in a structured format), DECIMAL (Decimal number), ALPHANUMERIC (Continuous alphanumeric string with no spaces), STRINGNOWHITESPACE (A string that contains no whitespace characters), SERIALNUMBER (A serial-number style string that contains letters and numbers, and certain symbols; must contain at least one number), ALPHAONLY (Alphabet characters only, no numbers or symbols or whitespace)" } MinimumCharacterCount: { type: "integer" format: "int32" description: "Optional - the target number of digits in the field; useful for fixed-length fields" } TopAnchor: { type: "string" description: "Optional - the top anchor of the column heading" } } } } TableID: { type: "string" description: "Optional; the ID of the table" } TargetRowHeight_Relative: { type: "number" format: "double" description: "Optional - scale factor for target row height - relative to height of column header" } TargetTableHeight_Relative: { type: "number" format: "double" description: "Optional - scale factor for target table height - relative to maximum height of headers of columns" } } } } } } language: { type: "string" } preprocessing: { type: "string" } recognitionMode: { type: "string" } } additionalProperties: false } output: { type: "object" description: "The result of extracting form field values" properties: { BestMatchFormSettingName: { type: "string" description: "Optional; populated when using photo/recognize/form/advanced with the Setting Name of the best-matching highest-relevance form" } Diagnostics: { type: "array" description: "Diagnostic images - default is null, enable diagnostics=true to populate this parameter with one image per field" items: { type: "string" } } FieldValueExtractionResult: { type: "array" description: "Result of form field OCR data extraction" items: { type: "object" description: "A pairing target field and actual value read from form" properties: { FieldValues: { type: "array" description: "Result field value(s) extracted" items: { type: "object" description: "A single text in an OCR document" properties: { BoundingPoints: { type: "array" description: "Points that form the bounding polygon around the text" items: { type: "object" description: "Point location in 2D in an image, where 0, 0 represents the top/left corner of the image" properties: { X: { type: "integer" format: "int32" description: "X location in 2D in the image, where 0 represents the left edge of the image" } Y: { type: "integer" format: "int32" description: "Y location in 2D in the image, where 0 represents the top edge of the image" } } } } ConfidenceLevel: { type: "number" format: "double" description: "Confidence level of the machine learning result; possible values are 0.0 (lowest accuracy) - 1.0 (highest accuracy)" } Height: { type: "integer" format: "int32" description: "Height of the word in pixels" } Text: { type: "string" description: "Text of the word" } Width: { type: "integer" format: "int32" description: "Width of the word in pixels" } XLeft: { type: "integer" format: "int32" description: "X location of the left edge of the word in pixels" } YTop: { type: "integer" format: "int32" description: "Y location of the top edge of the word in pixels" } } } } TargetField: { type: "object" description: "Definition of a form field for OCR data extraction from images" properties: { AllowNumericDigits: { type: "boolean" description: "Optional - set to false to block values that contain numeric digits, set to true to allow numeric digits" } AlternateAnchor: { type: "string" description: "Optional - alterate match text for the specified anchor" } AnchorMode: { type: "string" description: "Optional - the matching mode for the anchor. Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match) and Horizontal (anchor must be laid out horizontally). Default is Partial." } BottomAnchor: { type: "string" description: "Optional - the bottom anchor of the field" } DataType: { type: "string" description: "The data type of the field; possible values are INTEGER (Integer value), STRING (Arbitrary string value, spaces are permitted), DATE (Date in a structured format), DECIMAL (Decimal number), ALPHANUMERIC (Continuous alphanumeric string with no spaces), STRINGNOWHITESPACE (A string that contains no whitespace characters), SERIALNUMBER (A serial-number style string that contains letters and numbers, and certain symbols; must contain at least one number), ALPHAONLY (Alphabet characters only, no numbers or symbols or whitespace)" } FieldID: { type: "string" description: "The identifier of the field; use this to identify which field is being referenced. Set to SkipField if you do not wish to return the value of this field in the result." } HorizontalAlignmentType: { type: "string" description: "Horizontal alignment of target value area relative to the field anchor; Possible values are Left, Right" } Ignore: { type: "array" description: "Optional - Ignore any result items that contain a partial or complete match with these text strings" items: { type: "string" } } LeftAnchor: { type: "string" description: "Optional - the left-hand anchor of the field" } MinimumCharacterCount: { type: "integer" format: "int32" description: "Optional - the target number of digits in the field; useful for fixed-length fields" } Options: { type: "string" description: "Optional - additional options that can be set for this field definition, separated by commas. Possible values are AllowMultiMatch (allow the same anchor to be matched to multiple fields)" } TargetDigitCount: { type: "integer" format: "int32" description: "Optional - the target number of digits in the field; useful for fixed-length fields" } TargetFieldHeight_Relative: { type: "number" format: "double" description: "Optional - scale factor for target field height - relative to height of field title" } TargetFieldHorizontalAdjustment: { type: "number" format: "double" description: "Optional - horizontal adjestment in relative width of the field" } TargetFieldVerticalAdjustment: { type: "number" format: "double" description: "Optional - vertical adjestment in relative height of the field" } TargetFieldWidth_Relative: { type: "number" format: "double" description: "Optional - scale factor for target field width - relative to width of field title; a value of 1.0 indicates the target value area has the same width as the field value as occurring in the image; a value of 2.0 would indicate that the target value area has 2 times the width of the field value as occurring in the image." } TopAnchor: { type: "string" description: "Optional - the top anchor of the field" } VerticalAlignmentType: { type: "string" description: "Vertical alignment of target value area relative to the field anchor; Possible values are VCenter, Top, Bottom" } } } } } } Successful: { type: "boolean" description: "True if the operation was successful, false otherwise" } TableValueExtractionResults: { type: "array" description: "Result of form table OCR data extraction" items: { type: "object" description: "The result of reading a table via OCR from a form" properties: { TableDefinition: { type: "object" description: "Definition of a form table for OCR data extraction from images" properties: { ColumnDefinitions: { type: "array" description: "Definition of the columns in the table" items: { type: "object" description: "Definition of a column within a table for OCR data extraction from images" properties: { AllowNumericDigits: { type: "boolean" description: "Optional - set to false to block values that contain numeric digits, set to true to allow numeric digits" } AnchorMode: { type: "string" description: "Optional - the matching mode for the anchor. Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match). Default is Partial." } ColumnID: { type: "string" description: "The identifier of the field; use this to identify which field is being referenced" } DataType: { type: "string" description: "The data type of the field; possible values are INTEGER (Integer value), STRING (Arbitrary string value, spaces are permitted), DATE (Date in a structured format), DECIMAL (Decimal number), ALPHANUMERIC (Continuous alphanumeric string with no spaces), STRINGNOWHITESPACE (A string that contains no whitespace characters), SERIALNUMBER (A serial-number style string that contains letters and numbers, and certain symbols; must contain at least one number), ALPHAONLY (Alphabet characters only, no numbers or symbols or whitespace)" } MinimumCharacterCount: { type: "integer" format: "int32" description: "Optional - the target number of digits in the field; useful for fixed-length fields" } TopAnchor: { type: "string" description: "Optional - the top anchor of the column heading" } } } } TableID: { type: "string" description: "Optional; the ID of the table" } TargetRowHeight_Relative: { type: "number" format: "double" description: "Optional - scale factor for target row height - relative to height of column header" } TargetTableHeight_Relative: { type: "number" format: "double" description: "Optional - scale factor for target table height - relative to maximum height of headers of columns" } } } TableRowsResult: { type: "array" description: "Rows of data in the table" items: { type: "object" description: "One row of data in the resulting table" properties: { TableRowCellsResult: { type: "array" description: "Table cells in this row result" items: { type: "object" description: "The recognition result of one cell in one row in a table of a form" properties: { CellValues: { type: "array" description: "Result cell value(s) extracted" items: { type: "object" additionalProperties: true } } ColumnID: { type: "string" description: "The ID of the column" } } } } } } } } } } } } }