Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
version: v1
title: ocrapi PDF Ocr API
description: The powerful Optical Character Recognition (OCR) APIs let you convert scanned images of pages into recognized text.
servers:
- url: http://localhost
tags:
- name: PdfOcr
paths:
/ocr/pdf/toText:
post:
tags:
- PdfOcr
summary: Converts an uploaded PDF file into text via Optical Character Recognition
operationId: PdfOcr_Post
parameters:
- name: recognitionMode
in: header
description: Optional; possible values are 'Basic' which provides basic recognition and is not resillient to page rotation, skew or low quality images uses 1-2 API calls per page; 'Normal' which provides highly fault tolerant OCR recognition uses 26-30 API calls per page; and 'Advanced' which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls per page. Default recognition mode is 'Basic'
required: false
schema:
type: string
- name: language
in: header
description: Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
required: false
schema:
type: string
- name: preprocessing
in: header
description: Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
required: false
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/PdfToTextResponse'
text/json:
schema:
$ref: '#/components/schemas/PdfToTextResponse'
application/xml:
schema:
$ref: '#/components/schemas/PdfToTextResponse'
text/xml:
schema:
$ref: '#/components/schemas/PdfToTextResponse'
security:
- Apikey: []
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
imageFile:
type: string
description: PDF file to perform OCR on.
format: binary
required:
- imageFile
/ocr/pdf/get-job-status:
get:
tags:
- PdfOcr
summary: Returns the result of the Async Job - possible states can be STARTED or…
operationId: PdfOcr_GetAsyncJobStatus
parameters:
- name: AsyncJobID
in: query
required: true
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/PdfToTextResponse'
text/json:
schema:
$ref: '#/components/schemas/PdfToTextResponse'
application/xml:
schema:
$ref: '#/components/schemas/PdfToTextResponse'
text/xml:
schema:
$ref: '#/components/schemas/PdfToTextResponse'
security:
- Apikey: []
/ocr/pdf/to/words-with-location:
post:
tags:
- PdfOcr
summary: Convert a PDF into words with location
description: Converts a PDF into words/text with location information and other metdata via Optical Character Recognition. This API is intended to be run on scanned documents. If you want to OCR photos (e.g. taken with a smart phone camera), be sure to use the photo/toText API instead, as it is designed to unskew the image first.
operationId: PdfOcr_PdfToWordsWithLocation
parameters:
- name: language
in: header
description: Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
required: false
schema:
type: string
- name: preprocessing
in: header
description: Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
required: false
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/PdfToWordsWithLocationResult'
text/json:
schema:
$ref: '#/components/schemas/PdfToWordsWithLocationResult'
application/xml:
schema:
$ref: '#/components/schemas/PdfToWordsWithLocationResult'
text/xml:
schema:
$ref: '#/components/schemas/PdfToWordsWithLocationResult'
security:
- Apikey: []
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
imageFile:
type: string
description: PDF file to perform OCR on.
format: binary
required:
- imageFile
/ocr/pdf/to/lines-with-location:
post:
tags:
- PdfOcr
summary: Convert a PDF into text lines with location
description: Converts a PDF into lines/text with location information and other metdata via Optical Character Recognition. This API is intended to be run on scanned documents. If you want to OCR photos (e.g. taken with a smart phone camera), be sure to use the photo/toText API instead, as it is designed to unskew the image first.
operationId: PdfOcr_PdfToLinesWithLocation
parameters:
- name: language
in: header
description: Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
required: false
schema:
type: string
- name: preprocessing
in: header
description: Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
required: false
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/PdfToLinesWithLocationResult'
text/json:
schema:
$ref: '#/components/schemas/PdfToLinesWithLocationResult'
application/xml:
schema:
$ref: '#/components/schemas/PdfToLinesWithLocationResult'
text/xml:
schema:
$ref: '#/components/schemas/PdfToLinesWithLocationResult'
security:
- Apikey: []
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
imageFile:
type: string
description: PDF file to perform OCR on.
format: binary
required:
- imageFile
components:
schemas:
PdfToWordsWithLocationResult:
description: Response from an OCR to words with location operation. Includes the confience rating and converted text result, along with the locations of the words in the pages.
type: object
properties:
Successful:
description: True if successful, false otherwise
type: boolean
OcrPages:
description: OCR page results
type: array
items:
$ref: '#/components/schemas/OcrPageResultWithWordsWithLocation'
OcrLineElement:
description: A contiguous line of text in an OCR document
type: object
properties:
LineText:
description: Text of the line
type: string
Words:
description: Word objects in the line
type: array
items:
$ref: '#/components/schemas/OcrWordElement'
OcrPageResultWithWordsWithLocation:
description: OCR results of a page, including words of text and their location
type: object
properties:
PageNumber:
format: int32
description: Page number of the page that was OCR-ed, starting with 1 for the first page in the PDF file
type: integer
Successful:
description: True if successful, false otherwise
type: boolean
Words:
description: Word elements in the image
type: array
items:
$ref: '#/components/schemas/OcrWordElement'
PdfToTextResponse:
description: Response from an OCR to text operation. Includes the confidence rating and converted text result.
type: object
properties:
Successful:
description: True if successful, false otherwise
type: boolean
OcrPages:
description: Page OCR results
type: array
items:
$ref: '#/components/schemas/OcrPageResult'
AsyncJobID:
description: When the job exceeds 25 pages, an Async Job ID is returned. Use the CheckPdfOcrJobStatus API to check on the status of this job using the AsyncJobID and get the result when it finishes
type: string
AsyncJobStatus:
description: Returns the job status of the Async Job, if applicable. Possible states are STARTED and COMPLETED
type: string
PdfToLinesWithLocationResult:
description: Response from an OCR to lines with location operation. Includes the confience rating and converted text result, along with the locations of the lines in the pages.
type: object
properties:
Successful:
description: True if successful, false otherwise
type: boolean
OcrPages:
description: OCR results for each page
type: array
items:
$ref: '#/components/schemas/OcrPageResultWithLinesWithLocation'
OcrPageResultWithLinesWithLocation:
description: OCR results of a page, including lines of text and their location
type: object
properties:
PageNumber:
format: int32
description: Page number of the page that was OCR-ed, starting with 1 for the first page in the PDF file
type: integer
Successful:
description: True if successful, false otherwise
type: boolean
Lines:
description: Word elements in the image
type: array
items:
$ref: '#/components/schemas/OcrLineElement'
OcrPageResult:
type: object
properties:
PageNumber:
format: int32
description: Page number of the page that was OCR-ed, starting with 1 for the first page in the PDF file
type: integer
MeanConfidenceLevel:
format: float
description: Confidence level rating of the OCR operation; ratings above 80% are strong.
type: number
TextResult:
description: Converted text string from the image input.
type: string
OcrWordElement:
description: A single word in an OCR document
type: object
properties:
WordText:
description: Text of the word
type: string
LineNumber:
format: int32
description: Line number of the word
type: integer
WordNumber:
format: int32
description: Index of the word in the line
type: integer
XLeft:
format: int32
description: X location of the left edge of the word in pixels
type: integer
YTop:
format: int32
description: Y location of the top edge of the word in pixels
type: integer
Width:
format: int32
description: Width of the word in pixels
type: integer
Height:
format: int32
description: Height of the word in pixels
type: integer
ConfidenceLevel:
format: double
description: Confidence level of the machine learning result; possible values are 0.0 (lowest accuracy) - 1.0 (highest accuracy)
type: number
BlockNumber:
format: int32
description: Index of the containing block
type: integer
ParagraphNumber:
format: int32
description: Index of the containing paragraph
type: integer
PageNumber:
format: int32
description: Index of the containing page
type: integer
securitySchemes:
Apikey:
type: apiKey
description: API Key Authentication
name: Apikey
in: header
x-provenance:
method: harvested
publisher: Cloudmersive
source: https://api.cloudmersive.com/ocr/docs/v1/swagger
note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
stamped by stamp-openapi-provenance.py (roadmap#793)