{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF, DOCX & XLSX to Text",
    "description": "Convert PDF, Word (DOCX) and Excel (XLSX) files from URLs into plain text, Markdown for LLMs and RAG, tables as arrays, and metadata. Scanned PDF pages and images are read with OCR in 32 languages. Pay per document, plus per OCR page.",
    "version": "1.3",
    "x-build-id": "kxvhnci9mh5tUlvBd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/humble-echidna~document-to-text/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-humble-echidna-document-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/humble-echidna~document-to-text/runs": {
      "post": {
        "operationId": "runs-sync-humble-echidna-document-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/humble-echidna~document-to-text/run-sync": {
      "post": {
        "operationId": "run-sync-humble-echidna-document-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",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "Document URLs",
            "type": "array",
            "description": "Direct links to the documents, one per line: PDF, Word (.docx) or Excel (.xlsx) files, or images (PNG, JPEG, WebP, TIFF, GIF, BMP; read with OCR), on public web addresses (http/https, standard ports 80 and 443). The file type is read from the file itself, so links without an extension work too. Links to a download page, a viewer or a login page don't: use the link to the file. The default is three small US government documents (a PDF, a DOCX and an XLSX).",
            "default": [
              "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
              "https://www.uspto.gov/sites/default/files/documents/Initial-Filing-Template-August-2025.docx",
              "https://www.bls.gov/respondents/oes/template.xlsx"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxPagesPerDocument": {
            "title": "Max pages per PDF",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Read at most this many pages of each PDF: 1 to 100, default 50, counted from the first page or from the start of pages. pageCount in the output is always the whole document's. Word and Excel files have no fixed pages and are read up to the size limits in the README.",
            "default": 50
          },
          "pages": {
            "title": "Pages to read (PDF)",
            "type": "string",
            "description": "PDFs only: read only these pages of each PDF, e.g. 1-10, or 1-3, 7, 20- (20- means page 20 to the end). Leave empty (the default) to read from the first page. maxPagesPerDocument still applies. Pages past a document's end are skipped; a PDF with none of the pages is reported, not charged."
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "The password that opens your password-protected PDFs (the same one is tried on every PDF in the run that needs one). Stored encrypted, and only used to open the file inside the run. PDFs that don't need a password are read as usual; a wrong password is reported, not charged. Leave empty if your PDFs aren't protected."
          },
          "extractTables": {
            "title": "Extract PDF tables",
            "type": "boolean",
            "description": "Default false. When true, find tables in PDFs (from their ruling lines) and return them as arrays of rows and as Markdown tables in the markdown field. Off by default: the text is read with a much faster engine, and tables come back as plain text. Word and Excel tables are always returned (every Excel sheet is one table).",
            "default": false
          },
          "ocr": {
            "title": "Read scanned pages with OCR",
            "type": "boolean",
            "description": "Default true: read the text of scanned PDF pages (pages that are only a picture) and of image files with OCR (Tesseract), in the languages set in languages. Each page read this way is charged as an OCR page, on top of the document; pages that already have text are never OCR'd. Set false to only take the text layer: scanned PDFs and images are then reported, not charged.",
            "default": true
          },
          "languages": {
            "title": "Languages",
            "type": "array",
            "description": "The language(s) of the scanned text, as Tesseract codes, at most 4, e.g. [\"eng\", \"deu\"] for English and German. Default [\"eng\"] (English). Used only for OCR (ocr true). Pick every language that appears in your scans; each extra language makes OCR slower.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "pol",
                "ces",
                "slk",
                "swe",
                "dan",
                "nor",
                "fin",
                "hun",
                "ron",
                "tur",
                "ell",
                "rus",
                "ukr",
                "bul",
                "ara",
                "heb",
                "hin",
                "ben",
                "tha",
                "vie",
                "ind",
                "jpn",
                "chi_sim",
                "chi_tra",
                "kor"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch",
                "Polish",
                "Czech",
                "Slovak",
                "Swedish",
                "Danish",
                "Norwegian",
                "Finnish",
                "Hungarian",
                "Romanian",
                "Turkish",
                "Greek",
                "Russian",
                "Ukrainian",
                "Bulgarian",
                "Arabic",
                "Hebrew",
                "Hindi",
                "Bengali",
                "Thai",
                "Vietnamese",
                "Indonesian",
                "Japanese",
                "Chinese (Simplified)",
                "Chinese (Traditional)",
                "Korean"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "maxResults": {
            "title": "Max documents per run",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many converted documents in total, e.g. 20. Minimum 1; leave empty (the default) for no limit. The run also stops cleanly at the maximum cost per run you set in the run options, whichever comes first. Set it to keep a run small and quick."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}