{
  "openapi": "3.0.1",
  "info": {
    "title": "OCR: Image & PDF to Text — Scanned PDF, Screenshot, Photo OCR",
    "description": "OCR API for images and PDFs: extract text from scanned PDFs, screenshots, photos, receipts and invoices, with line boxes, confidence and detected language. Reads a PDF's own text when it has one. 40+ languages, rotated pages fixed. Export to JSON, CSV, TXT or Markdown, or via API.",
    "version": "1.0",
    "x-build-id": "exjXny6RRva6Bsmmo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/steadyscrape~ocr-image-pdf-to-text/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-steadyscrape-ocr-image-pdf-to-text",
        "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/steadyscrape~ocr-image-pdf-to-text/runs": {
      "post": {
        "operationId": "runs-sync-steadyscrape-ocr-image-pdf-to-text",
        "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/steadyscrape~ocr-image-pdf-to-text/run-sync": {
      "post": {
        "operationId": "run-sync-steadyscrape-ocr-image-pdf-to-text",
        "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 or PDF links",
            "maxItems": 1000,
            "type": "array",
            "description": "Links to your own images (PNG, JPG, WebP, TIFF including multi-page scans, BMP, GIF, HEIC) and PDFs, up to 300 MB each. Google Drive and Dropbox share links (shared with anyone with the link), Google Docs links, and signed links of Apify key-value records work as they are. Pages of Instagram, TikTok, Facebook, X, YouTube and other platforms are refused before anything is downloaded, free.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Or take the links from a dataset",
            "type": "string",
            "description": "Pick the dataset of another run (screenshots, product images, scraped PDFs, invoices) and every image or PDF link in it is read. Only the dataset you pick here can be read."
          },
          "datasetFields": {
            "title": "Dataset fields with the links",
            "type": "array",
            "description": "The fields of each dataset item that hold the links, as dotted paths (images.url takes the url of every element of images). Leave empty to take every link in a field named like image, screenshot, scan, pdf, document, file, receipt or invoice, or ending in .pdf, .png, .jpg and the like (thumbnails, avatars and logos are left out).",
            "items": {
              "type": "string"
            }
          },
          "script": {
            "title": "Language / script",
            "enum": [
              "latin",
              "japanese",
              "korean",
              "cyrillic",
              "arabic",
              "devanagari",
              "thai",
              "greek",
              "tamil",
              "telugu"
            ],
            "type": "string",
            "description": "The alphabet of the text. One run reads one script: the default reads English, Spanish, French, German, Portuguese, Italian, Dutch, the Nordic languages, Indonesian and other Latin-alphabet languages, plus Chinese (simplified and traditional), all mixed on one page. Polish, Czech, Romanian and Vietnamese are read with some of their accents lost. The language of each page is detected and given in its row.",
            "default": "latin"
          },
          "pdfMode": {
            "title": "PDF pages",
            "enum": [
              "auto",
              "ocr",
              "text-layer-only"
            ],
            "type": "string",
            "description": "A PDF page made by a program (Word, a browser, an invoicing system) carries its own text: <b>auto</b> reads that text exactly and cheaply (the <code>text-page</code> event) and OCRs only scanned pages. <b>Always OCR</b> reads every page from its picture, for PDFs whose own text is wrong. <b>Own text only</b> never OCRs: scanned pages come back as free rows.",
            "default": "auto"
          },
          "pages": {
            "title": "Pages",
            "type": "string",
            "description": "Which pages of each PDF or multi-page TIFF to read, like <code>1-3, 5, 10-</code> (10- is page 10 to the end). Empty reads every page, up to the limit below."
          },
          "maxPagesPerFile": {
            "title": "Max pages per file",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Pages past this are left out and named in a free row, so one long PDF cannot spend the whole run.",
            "default": 100
          },
          "autoRotate": {
            "title": "Fix rotated pages",
            "type": "boolean",
            "description": "Find pages and photos whose text is turned 90, 180 or 270 degrees (sideways scans, upside-down photos) and read them the right way up. The row gives the rotation found; boxes stay on the picture as you sent it.",
            "default": true
          },
          "outputFiles": {
            "title": "Also save each file as",
            "type": "array",
            "description": "One file per input file in the run's key-value store, every page of it in order, with a link that opens for anyone in every row of that file: <b>txt</b> (pages apart by a form feed), <b>md</b> (Markdown with page headings), <b>json</b> (pages, blocks and lines with their boxes). Rows always carry each page's text, blocks and lines.",
            "items": {
              "type": "string",
              "enum": [
                "txt",
                "md",
                "json"
              ],
              "enumTitles": [
                "Plain text (.txt)",
                "Markdown (.md)",
                "Layout JSON with boxes (.json)"
              ]
            },
            "default": []
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}