{
  "openapi": "3.0.1",
  "info": {
    "title": "Image to Text OCR and Scanned PDF Text Extractor",
    "description": "Image to text OCR and PDF text extractor: read scanned PDFs, photos, screenshots and receipts in about 80 languages with PP-OCRv6, from links or another Actor's dataset. PDF pages with their own text are read exactly. No API key or login. $3 per 1,000 OCR pages. Maintained by CleanScrape.",
    "version": "0.1",
    "x-build-id": "NkXwEN3kfHZ4ibsrO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cleanscrape~image-pdf-ocr-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cleanscrape-image-pdf-ocr-text-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/cleanscrape~image-pdf-ocr-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-cleanscrape-image-pdf-ocr-text-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/cleanscrape~image-pdf-ocr-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-cleanscrape-image-pdf-ocr-text-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "files": {
            "title": "Image and PDF links",
            "type": "array",
            "description": "One link per line to an image (JPEG, PNG, WebP, HEIC, TIFF, BMP, GIF) or a PDF. Dropbox, Google Drive and GitHub file links work when the file is shared publicly. You can also paste a block of text: every link in it is used, and a repeated link is read once.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Links from a dataset (optional)",
            "type": "string",
            "description": "A dataset whose rows hold image or PDF links. Its links are added to the ones above (remove the sample links there)."
          },
          "datasetField": {
            "title": "Link field in the dataset (optional)",
            "type": "string",
            "description": "The field that holds the file link, such as downloadUrl, imageUrl or images.url. Leave empty to pick it automatically: a field named like download, image, photo, scan, file or pdf, or one whose links end in .jpg, .png or .pdf."
          },
          "script": {
            "title": "Writing system",
            "enum": [
              "latin",
              "chinese_traditional",
              "cyrillic",
              "korean",
              "arabic",
              "greek",
              "thai",
              "devanagari",
              "tamil",
              "telugu"
            ],
            "type": "string",
            "description": "The script of the text in your files. The first choice reads about 50 languages written in Latin letters together with Chinese and Japanese, and English words and numbers are read in every choice. Choose one writing system per run.",
            "default": "latin"
          },
          "readMode": {
            "title": "PDF pages",
            "enum": [
              "auto",
              "ocr",
              "text"
            ],
            "type": "string",
            "description": "A PDF made on a computer carries its text: reading it is exact and costs much less. Scanned pages, and pages that are one big picture, are read with OCR. Images always use OCR.",
            "default": "auto"
          },
          "quality": {
            "title": "OCR quality",
            "enum": [
              "standard",
              "fast",
              "accurate"
            ],
            "type": "string",
            "description": "The model size used for OCR. Standard read 99 to 100% of the words on test pages, and 95 to 98% of the letters on blurry phone photos. The price per page is the same for every choice; slower choices just take longer.",
            "default": "standard"
          },
          "pages": {
            "title": "Pages (optional)",
            "type": "string",
            "description": "Which PDF pages to read, such as 1-5, 8, 12- (12- means page 12 to the end). Empty: every page. Applies to every PDF in the run."
          },
          "maxPagesPerFile": {
            "title": "Pages per file",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "The most pages read from one PDF or multi-page TIFF. Pages past it are left out and named in the file's note.",
            "default": 200
          },
          "maxFileMb": {
            "title": "Largest file (MB)",
            "minimum": 1,
            "maximum": 2048,
            "type": "integer",
            "description": "A larger file is stopped while it downloads and listed in the \"Not read\" table, free.",
            "default": 200
          },
          "includeLines": {
            "title": "Include line positions",
            "type": "boolean",
            "description": "Adds every OCR line with its confidence and position (x, y, width, height in pixels) to the pages table. Useful for forms, highlighting and checking low-confidence lines.",
            "default": false
          },
          "pdfPassword": {
            "title": "PDF password (optional)",
            "type": "string",
            "description": "For password-protected PDFs. The same password is tried on every PDF in the run."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}