{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Text Extractor with OCR | 💵$0.005 per PDF",
    "description": "[💵 $0.005 per PDF + $0.0004 per page · no start fee] Any PDF URL into clean, layout-aware text that reads multi-column pages in the right order. Whole document and page by page, plus metadata, bookmarks and links. Optional OCR reads scanned pages, billed only for the pages it reads.",
    "version": "0.1",
    "x-build-id": "pvvFKTmfBB4JPsEgt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/webdata_labs~pdf-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-webdata_labs-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/webdata_labs~pdf-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-webdata_labs-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/webdata_labs~pdf-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-webdata_labs-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",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct links to the PDF files you want to read. Any public HTTP or HTTPS link works, including files stored on S3, Google Cloud Storage, an Apify key-value store or your own server. Redirects are followed. Aliases startUrls, pdfUrls, fileUrls and links are accepted too.",
            "default": [
              "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
              "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxPdfs": {
            "title": "Maximum PDFs",
            "minimum": 0,
            "type": "integer",
            "description": "Safety cap on how many PDFs this run may process, so an oversized list cannot surprise you with a bill. Set 0 for no cap.",
            "default": 100
          },
          "includePageText": {
            "title": "Include page-by-page text",
            "type": "boolean",
            "description": "Add a pages array with the text, character count, word count and dimensions of every single page, on top of the whole-document text. Turn off for smaller rows when you only need the full text.",
            "default": true
          },
          "includeOutline": {
            "title": "Include bookmarks and outline",
            "type": "boolean",
            "description": "Extract the PDF's table of contents as an outline array, with each entry's nesting level and the page number it points to.",
            "default": true
          },
          "includeLinks": {
            "title": "Include hyperlinks",
            "type": "boolean",
            "description": "Extract every clickable link annotation in the document, with the page each link sits on.",
            "default": true
          },
          "chunkChars": {
            "title": "Chunk size in characters",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Split the text into page-tagged chunks of about this many characters, breaking on paragraph boundaries and never across pages, so every chunk keeps a citable page number. Set 0 to skip chunking.",
            "default": 0
          },
          "ocr": {
            "title": "Read scanned pages with OCR",
            "type": "boolean",
            "description": "Read pages that have no text layer by recognising the page image. Adds the ocrApplied and ocrConfidence fields to every page and fills text for scans. OCR takes a few seconds per page, so runs over scanned files are slower than plain text extraction.",
            "default": false
          },
          "ocrLanguage": {
            "title": "OCR language",
            "enum": [
              "eng",
              "deu",
              "fra",
              "spa",
              "ita",
              "por",
              "nld",
              "pol",
              "ukr",
              "rus"
            ],
            "type": "string",
            "description": "Language of the scanned text. Picking the right one matters: the wrong language costs accuracy on accented and non-Latin scripts. Only used when OCR is on.",
            "default": "eng"
          },
          "maxOcrPages": {
            "title": "Maximum OCR pages per PDF",
            "minimum": 0,
            "type": "integer",
            "description": "Safety cap on how many scanned pages may be read per file, so one 500-page scan cannot surprise you with a bill or a very long run. The row records ocrTruncated when the cap stopped it. Set 0 for no cap.",
            "default": 50
          },
          "passwords": {
            "title": "Passwords to try",
            "type": "array",
            "description": "Optional list of passwords. Every encrypted PDF is opened with the first password that works, and the row records whether decryption was needed. Leave empty if none of your files are protected.",
            "default": [],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}