{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF OCR - Scanned PDF to Text & Markdown, Page by Page",
    "description": "Convert public scanned PDF links to text or Markdown, one row per page by default. Text-bearing pages cost $0.003 each; blank and failed pages are free. Select page ranges or combine a PDF into one result row.",
    "version": "0.1",
    "x-build-id": "MQWJfSKcKHcNJW4t7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tidytools~pdf-to-text-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tidytools-pdf-to-text-ocr",
        "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/tidytools~pdf-to-text-ocr/runs": {
      "post": {
        "operationId": "runs-sync-tidytools-pdf-to-text-ocr",
        "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/tidytools~pdf-to-text-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-tidytools-pdf-to-text-ocr",
        "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": {
          "urls": {
            "title": "PDF URLs or shared file links",
            "type": "array",
            "description": "Paste public PDF URLs, one per line, or Google Drive, Dropbox and OneDrive share links. A PDF up to 15 MB is read page by page; password-protected files return a free error. The prefilled three-page sample runs and charges normally when used alone. If you keep it and add another valid URL, imageUrls entry, dataset URL, or base64 image, the sample is skipped and only your sources are processed and charged. Image URLs also work. Invalid lines and duplicate URLs are free.",
            "items": {
              "type": "string"
            }
          },
          "imageUrls": {
            "title": "Image URL list or file (optional)",
            "type": "array",
            "description": "The same as \"Image URLs\", in the URL list editor: you can also upload or link a text/CSV file of image links.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "mode": {
            "title": "Output format",
            "enum": [
              "text",
              "markdown",
              "receipt_fields",
              "table_rows"
            ],
            "type": "string",
            "description": "Plain text keeps line breaks; Markdown keeps tables. Table rows adds columns/rows to Markdown text for complete regular pipe tables; tableReview flags missing or irregular tables. Receipt / invoice fields keep full text and add receipt.vendor/date/total/currency/review from explicit labels; missing or ambiguous values need review. PDFs use same mode. Check against source; fields aren't accounting-grade. Each image or PDF page with text costs one image-ocr event; no-text and failures are free.",
            "default": "markdown"
          },
          "language": {
            "title": "Language hint (optional)",
            "type": "string",
            "description": "Main language of the text, e.g. Japanese, Traditional Chinese, German. Optional: the text is transcribed in its original language either way; a hint can help with small or stylized script."
          },
          "preserveCheckboxes": {
            "title": "Keep form checkboxes in images (☐ ☑ ☒)",
            "type": "boolean",
            "description": "Images only: write ☐ (empty), ☑ (check mark) or ☒ (X mark, selected) for a form checkbox with readable label text and a clear state; unclear boxes keep only their label. An answer of only ☐ ☑ ☒, whitespace and Markdown layout is no_text and free (charged with the option off); anything else visible, even a lone X, is charged. Long images read by page OCR get checkboxReview:true. PDFs ignore this option. Event and price unchanged.",
            "default": false
          },
          "datasetId": {
            "title": "Dataset ID (optional)",
            "type": "string",
            "description": "Take image URLs from another Actor run's dataset (e.g. a scraper's image field)."
          },
          "datasetField": {
            "title": "Dataset field",
            "type": "string",
            "description": "Field with the image URL, e.g. \"imageUrl\", or an array of image URLs such as \"images\" (up to 100 per item). Empty = the first URL field found."
          },
          "imagesBase64": {
            "title": "Base64 images (optional)",
            "type": "array",
            "description": "Images sent as base64 strings, data URLs (data:image/png;base64,...) or objects {\"id\": \"receipt-17\", \"data\": \"<base64>\"} (the id is returned with the result), for images that are not online. Mainly for API and AI-agent use."
          },
          "maxConcurrency": {
            "title": "Parallel images",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many images are transcribed at the same time.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy (optional)",
            "type": "object",
            "description": "Only used to download images from sites that block data-center requests. Apify proxy usage is billed to your Apify account."
          },
          "maxSecondsPerImage": {
            "title": "Time limit per image (seconds)",
            "minimum": 30,
            "maximum": 300,
            "type": "integer",
            "description": "An image that is not finished in this time (slow download or a very long text) is reported as failed with errorType \"timeout\" and is not charged, so one stuck image cannot hold the run. A dense page can need 1-3 minutes. If the first answer is cut off and page OCR fails, a tall image may use up to two extra region reads when time allows; it can still be marked truncated. The limit stays 30-300 seconds and one image with returned text has one image-ocr charge.",
            "default": 180
          },
          "maxPdfPages": {
            "title": "Maximum PDF pages per file",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "At most this many selected pages are read from each PDF; extra pages are skipped without charge. Default 50.",
            "default": 50
          },
          "pageRange": {
            "title": "PDF page range (optional)",
            "type": "string",
            "description": "One-based PDF pages, such as 1-5,8. Empty reads the first pages up to Maximum PDF pages."
          },
          "mergePdfPages": {
            "title": "One result row per PDF",
            "type": "boolean",
            "description": "Combine selected PDF pages into one dataset row, keeping a pages array and charging one image-ocr event for each page with text. Default is one row per page.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}