# OCR.space

OCR.space provides a free and paid OCR API for extracting text from images and PDFs, returning results in JSON format.

- **Category:** ai document extraction
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 3
- **Triggers:** 0
- **Slug:** `OCRSPACE`
- **Version:** 20260316_00

## Tools

### Get Conversion Statistics

**Slug:** `OCRSPACE_GET_CONVERSIONS`

Retrieve OCR API conversion statistics and usage data (PRO accounts only). Returns the number of conversions for Engine1, Engine2, and total conversions. Data is updated once daily and shows conversions from start of month to end of yesterday. Free API keys will return 0 conversions.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `startDate` | string ("lastMonth") | No | Start date option for conversion statistics. Case-sensitive. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Extract Text from Image/PDF (OCR)

**Slug:** `OCRSPACE_OCR_PARSE_IMAGE_POST`

Extract text from images and PDF documents using OCR (Optical Character Recognition). Supports 27 languages, table recognition, orientation detection, and word-level coordinate extraction. Provide exactly one of `file`, `url`, or `base64Image`; providing multiple or none triggers E301/OCRExitCode 99. Input can be provided as file upload, public URL, or base64-encoded data URI. Response is nested JSON; extract text from `ParsedResults[*].ParsedText`. Returns extracted text with optional overlay coordinates and searchable PDF generation. For poor-quality scans, enable both `detectOrientation` and `scale` and ensure `language` matches the document.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | No | Publicly accessible URL of the image or PDF file. IMPORTANT: Must also set 'filetype' parameter (e.g., 'PNG', 'JPG', 'PDF') when using this option. |
| `file` | string | No | Binary content of image or PDF file for upload (multipart/form-data). Supports JPG, PNG, GIF, PDF, BMP, TIF formats. |
| `scale` | boolean | No | If True, automatically upscales low-resolution images before OCR processing to improve text recognition accuracy. |
| `isTable` | boolean | No | If True, optimizes OCR for table/structured data recognition. Recommended for receipts, invoices, and tabular documents. |
| `filetype` | string | No | File format specification. REQUIRED when using 'url' or 'base64Image' parameters. Valid values: 'PDF', 'GIF', 'PNG', 'JPG', 'TIF', 'BMP'. Not needed for 'file' parameter. |
| `language` | string ("ara" | "bul" | "chs" | "cht" | "hrv" | "cze" | "dan" | "dut" | "eng" | "fin" | "fre" | "ger" | "gre" | "hun" | "kor" | "ita" | "jpn" | "pol" | "por" | "rus" | "slv" | "spa" | "swe" | "tha" | "tur" | "ukr" | "vnm") | No | OCR language code: ara=Arabic, bul=Bulgarian, chs=Chinese Simplified, cht=Chinese Traditional, hrv=Croatian, cze=Czech, dan=Danish, dut=Dutch, eng=English, fin=Finnish, fre=French, ger=German, gre=Greek, hun=Hungarian, kor=Korean, ita=Italian, jpn=Japanese, pol=Polish, por=Portuguese, rus=Russian, slv=Slovenian, spa=Spanish, swe=Swedish, tha=Thai, tur=Turkish, ukr=Ukrainian, vnm=Vietnamese |
| `OCREngine` | integer ("1" | "2") | No | OCR processing engine selection. 1=Standard engine (default, reliable), 2=Experimental engine (may have better accuracy for some documents) |
| `base64Image` | string | No | Base64-encoded image as a data URI string. Format: 'data:image/[format];base64,[encoded-data]'. IMPORTANT: Must also set 'filetype' parameter when using this option. |
| `detectOrientation` | boolean | No | If True, automatically detects and corrects text orientation (rotation). Returns detected orientation angle in TextOrientation field. |
| `isOverlayRequired` | boolean | No | If True, returns word-level bounding box coordinates (Left, Top, Height, Width) for each detected word. Useful for document layout analysis. |
| `isCreateSearchablePdf` | boolean | No | If True, generates a searchable PDF with an invisible text layer overlay. Returns PDF URL in SearchablePDFURL field. |
| `isSearchablePdfHideTextLayer` | boolean | No | If True (and isCreateSearchablePdf=True), hides the text layer in the generated searchable PDF. The text is still searchable but not visible. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Extract Text from Image URL (GET)

**Slug:** `OCRSPACE_PARSE_IMAGE_URL`

Extract text from images via URL using simplified GET endpoint. Only supports URL-based submissions - no file uploads or base64 encoding. Faster and simpler than POST endpoint for basic use cases.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | Yes | Publicly accessible URL of the image or PDF file to OCR. Must be a valid HTTP/HTTPS URL. |
| `language` | string ("ara" | "bul" | "chs" | "cht" | "hrv" | "cze" | "dan" | "dut" | "eng" | "fin" | "fre" | "ger" | "gre" | "hun" | "kor" | "ita" | "jpn" | "pol" | "por" | "rus" | "slv" | "spa" | "swe" | "tha" | "tur" | "ukr" | "vnm") | No | OCR language code: ara=Arabic, bul=Bulgarian, chs=Chinese Simplified, cht=Chinese Traditional, hrv=Croatian, cze=Czech, dan=Danish, dut=Dutch, eng=English, fin=Finnish, fre=French, ger=German, gre=Greek, hun=Hungarian, kor=Korean, ita=Italian, jpn=Japanese, pol=Polish, por=Portuguese, rus=Russian, slv=Slovenian, spa=Spanish, swe=Swedish, tha=Thai, tur=Turkish, ukr=Ukrainian, vnm=Vietnamese |
| `isOverlayRequired` | boolean | No | If True, returns word-level bounding box coordinates (Left, Top, Height, Width) for each detected word. Useful for document layout analysis. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
