Vision.RecognizeTextJSON
------------------------

Recognizes text and returns result as JSON.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Vision](component_Vision.md) | [13.2](newinversion132.md) | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ✅ Yes |

MBS( "Vision.RecognizeTextJSON"; Image { ; Recognition Levels; Languages; CustomWords; PageLimit } ) 

**MBS**( **"Vision.RecognizeTextJSON";** /\* Recognizes text and returns result as JSON. \*/  
**$Image**; /\* The image to analyze.  
Can be container value with JPEG, PNG or other image formats supported by Vision framework. \*/   
**$Recognition Levels**; /\* Optional; Can be "Fast" or "Accurate".  
macOS and iOS only. Ignored on Windows.e.g. "Accurate" \*/   
**$Languages**; /\* Optional; Specify the languages used for the detection.   
The order of the languages in the array defines the order in which languages will be used during the language processing.  
The languages are specified as ISO language codes.e.g. "en\_US" \*/   
**$CustomWords**; /\* Optional; An array of strings that will be used at the word recognition stage in addition to the recognition languages. The customWords list takes precedence over the standard lexicon.  
macOS and iOS only. Ignored on Windows.e.g. "FileMaker¶Claris" \*/   
**$PageLimit**) /\* Optional; The maximum page count allowed for PDF pages.  
Default is 1 to only look on first page.  
It is highly recommended to use a limit to only get text from first n pages due to the time it takes to render pages and recognize text.  
Pass 0 for no limit.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Image | The image to analyze.   Can be container value with JPEG, PNG or other image formats supported by Vision framework. | $image |  |
| Recognition Levels | Can be "Fast" or "Accurate".   macOS and iOS only. Ignored on Windows. | "Accurate" | Optional |
| Languages | Specify the languages used for the detection.    The order of the languages in the array defines the order in which languages will be used during the language processing.   The languages are specified as ISO language codes. | "en\_US" | Optional |
| CustomWords | An array of strings that will be used at the word recognition stage in addition to the recognition languages. The customWords list takes precedence over the standard lexicon.   macOS and iOS only. Ignored on Windows. | "FileMaker¶Claris" | Optional |
| PageLimit | The maximum page count allowed for PDF pages.   Default is 1 to only look on first page.   It is highly recommended to use a limit to only get text from first n pages due to the time it takes to render pages and recognize text.   Pass 0 for no limit. | 1 | Optional |

### Result

Returns JSON or error.

### Description

Recognizes text and returns result as JSON.  
Same as [Vision.RecognizeText](VisionRecognizeText.md), but with output as JSON.  
  
See also [OCR.GetTextAsJSON](OCRGetTextAsJSON.md) for cross platform [OCR](component_OCR.md) functions and [WindowsOCR.Result](WindowsOCRResult.md) for Windows text recognition.  
### Examples

Recognize text:

 Set Field \[ Vision::Result ; MBS ( "Vision.RecognizeTextJSON"; Vision::Image ; "Accurate") \]  
<small>  
Example result:   
\[ { "Height" : 38.423806662128612 , "Text" : "This gift card belongs to" , "Confidence" : 1 , "X" : 78.596402532565676 , "Width" : 219.87482312802641 , "Y" : 167.57112121991196 }, { "Height" : 52.155108398437484 , "Text" : "Jonathon" , "Confidence" : 1 , "X" : 84.337137077320179 , "Width" : 135.1397418776852 , "Y" : 200.04041162109377 } \] </small>### See also

- [OCR.GetText](OCRGetText.md)
- [OCR.GetTextAsJSON](OCRGetTextAsJSON.md)
- [Vision.RecognizeText](VisionRecognizeText.md)
- [WindowsOCR.Result](WindowsOCRResult.md)

### Release notes

- **Version 16.1**
    - Changed [Vision.RecognizeText](https://www.mbsplugins.eu/VisionRecognizeText.shtml) and [Vision.RecognizeTextJSON](https://www.mbsplugins.eu/VisionRecognizeTextJSON.shtml) to auto detect the language.

### Example Databases

- [Mac and iOS/Vision](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/Vision.shtml#8ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 16.1pr1](https://www.mbsplugins.de/archive/2026-02-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin Advent calendar: 2 - Vision](https://www.mbsplugins.de/archive/2023-12-02/MBS_Plugin_Advent_calendar_2_-/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 13.2](https://www.mbsplugins.de/archive/2023-05-17/New_in_MBS_FileMaker_Plugin_13/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 9th March 2023 , last changed 6th September 2023

  
[Vision.RecognizeText](VisionRecognizeText.md) - [Vision.RectifyDocument](VisionRectifyDocument.md)

[HTML Version](VisionRecognizeTextJSON.shtml)