{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Text: PDF Text Extractor with OCR Fallback",
    "description": "PDF to text: reads each page's text layer and OCRs scanned pages locally. Uploads or file URLs, no API key, no proxy. Pay per page.",
    "version": "0.1",
    "x-build-id": "mUdn5NkuBbSaQEa0x"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/luxe_tasks~pdf-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-luxe_tasks-pdf-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/luxe_tasks~pdf-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-luxe_tasks-pdf-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/luxe_tasks~pdf-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-luxe_tasks-pdf-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": "PDF files",
            "type": "array",
            "description": "PDF files (max 20 MB and 1,000 pages each; at most 50 pages per file are read with OCR). Optional: leave empty and switch on Include sample document to try the Actor. Uploads: [{\"key\": \"report\"}] for a record in this run's default key-value store. File URLs: [{\"fileUrl\": \"https://example.com/doc.pdf\"}] - only documents you own or are licensed to process, one file per URL, no crawling; needs the attestation below. At most 50 file URLs per registered domain and 200 per run (more are skipped and not fetched; the start fee of $0.005 per GB of memory, $0.01 at the default 2 GB, still applies). URLs with a user name or password (user:pass@host) are refused; presigned URLs (not Apify storage links: use the upload field) are accepted and their query strings are never logged."
          },
          "ocrFallback": {
            "title": "OCR pages without a text layer",
            "type": "boolean",
            "description": "On: pages with no usable text layer (scans, images) are read with local OCR. Off: only the embedded text layer is read; other pages are reported as no_text_layer, with no page charge (the start fee of $0.005 per GB of memory, $0.01 at the default 2 GB, still applies).",
            "default": true
          },
          "language": {
            "title": "OCR language",
            "enum": [
              "eng"
            ],
            "type": "string",
            "description": "OCR language model for pages without a text layer (Tesseract tessdata, English). English only in this version; text layers in any language are read as-is.",
            "default": "eng"
          },
          "layout": {
            "title": "Page layout",
            "enum": [
              "auto",
              "single-column",
              "sparse"
            ],
            "type": "string",
            "description": "auto = automatic page segmentation; single-column = one block of text; sparse = scattered text (forms, labels).",
            "default": "auto"
          },
          "renderDpi": {
            "title": "PDF render resolution (dpi)",
            "minimum": 100,
            "maximum": 300,
            "type": "integer",
            "description": "PDF pages are rendered at this resolution before OCR (capped at 25 megapixels per page).",
            "default": 200
          },
          "pageTimeoutSecs": {
            "title": "Per-page OCR timeout (seconds)",
            "minimum": 10,
            "maximum": 120,
            "type": "integer",
            "description": "A page that takes longer is reported as ocr_timeout, with no page charge (the start fee of $0.005 per GB of memory, $0.01 at the default 2 GB, still applies).",
            "default": 60
          },
          "maxPagesPerFile": {
            "title": "Max pages per PDF",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "PDFs with more pages are refused (too_many_pages), with no page charge (the start fee of $0.005 per GB of memory, $0.01 at the default 2 GB, still applies). At most 50 pages per PDF are read with OCR.",
            "default": 1000
          },
          "maxTextPagesPerRun": {
            "title": "Max text-layer pages per run",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Pages read from text layers after this many get the status run_text_page_limit, with no page charge (the start fee of $0.005 per GB of memory, $0.01 at the default 2 GB, still applies).",
            "default": 2000
          },
          "maxOcrPagesPerRun": {
            "title": "Max OCR pages per run",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Scanned pages after this many get the status run_ocr_page_limit, with no page charge (the start fee of $0.005 per GB of memory, $0.01 at the default 2 GB, still applies). The maximum (500) needs a 3,600 s run timeout.",
            "default": 100
          },
          "includeTextInDataset": {
            "title": "Include text in the dataset",
            "type": "boolean",
            "description": "Also copy the text (first 100,000 characters) into each dataset record. The full text is always saved as a .txt file in the run's key-value store.",
            "default": true
          },
          "uploadedFile": {
            "title": "Upload a PDF",
            "type": "string",
            "description": "Upload one PDF from your computer (stored in your Apify key-value store and read by the Actor through the Apify platform, never downloaded from a link). Same limits and statuses as other files; refused files get a status row with no page charge, and the start fee of $0.005 per GB of memory, $0.01 at the default 2 GB, still applies.",
            "default": ""
          },
          "includeSampleDocument": {
            "title": "Include sample document",
            "type": "boolean",
            "description": "Adds one extra row: a short 2-page sample PDF that ships with the Actor (page 1 text layer, page 2 scanned). Sample rows are not billed events, but the start fee of $0.005 per GB of memory, $0.01 at the default 2 GB, still applies.",
            "default": false
          },
          "documentRightsAttestation": {
            "title": "I own or am licensed to process every document at these URLs, and fetching them does not get around any access control.",
            "type": "boolean",
            "description": "Required only when you give file URLs. Leave unticked for uploads.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Items processed in parallel (each site still gets at most 1 request per second).",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}