{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF & Document Text Extractor: PDF, DOCX, PPTX, XLSX to Text",
    "description": "Turn public document URLs (PDF, DOCX, PPTX, XLSX, CSV, HTML, TXT) into clean text: whole document, per page or RAG-ready chunks, with metadata, language, word count, links and approximate tables. Built for AI agents, search indexes and data pipelines. Pay only for successful extractions.",
    "version": "1.0",
    "x-build-id": "Lg76jTWKrqhLo4w8d"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/angadseth~pdf-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-angadseth-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/angadseth~pdf-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-angadseth-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/angadseth~pdf-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-angadseth-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": "Document URLs",
            "type": "array",
            "description": "One public link per line to a PDF, DOCX, PPTX, XLSX, CSV, HTML or TXT file. The type is detected from the file itself, so links without an extension work too. Google Drive and Dropbox share links are turned into direct downloads. Files behind a login cannot be read.",
            "default": [
              "https://www.rfc-editor.org/rfc/rfc9309.pdf"
            ],
            "items": {
              "type": "string"
            }
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "documents",
              "pages",
              "chunks"
            ],
            "type": "string",
            "description": "Documents = one record per file with full text, per-page text, metadata, links and tables. Pages = one record per page (slide for PPTX, sheet for XLSX). Chunks = overlapping text chunks sized for embeddings, RAG and AI agents. You pay per record, so the mode decides the count.",
            "default": "documents"
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 100,
            "maximum": 100000,
            "type": "integer",
            "description": "Chunks mode only. Target length of each chunk in characters (about 4 characters per token). Chunks end at a paragraph, line, sentence or word boundary.",
            "default": 1500
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 50000,
            "type": "integer",
            "description": "Chunks mode only. How many characters each chunk repeats from the end of the previous one, so context is not lost at the cut. At most half the chunk size.",
            "default": 200
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stop after this many records in total (documents, pages or chunks, depending on Output mode). You pay per record saved.",
            "default": 1000
          },
          "maxPagesPerDocument": {
            "title": "Max pages per PDF",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Read only the first N pages of each PDF, e.g. to sample long reports. 0 = all pages.",
            "default": 0
          },
          "includeFullText": {
            "title": "Include full text",
            "type": "boolean",
            "description": "Documents mode: add the whole document text in one field.",
            "default": true
          },
          "includePages": {
            "title": "Include per-page text",
            "type": "boolean",
            "description": "Documents mode: add a pages array with the text and word count of each page. Turn off for smaller records.",
            "default": true
          },
          "extractTables": {
            "title": "Extract tables",
            "type": "boolean",
            "description": "Add tables as rows of cells. Exact for XLSX, CSV, DOCX, PPTX and HTML; approximate for PDF (found from the text layout).",
            "default": true
          },
          "removeHeadersFooters": {
            "title": "Remove running headers and footers",
            "type": "boolean",
            "description": "Drop lines that repeat at the top or bottom of most pages (running titles, page numbers), so the text reads cleanly.",
            "default": true
          },
          "includeSpeakerNotes": {
            "title": "Include PPTX speaker notes",
            "type": "boolean",
            "description": "Add the speaker notes of each slide after its text.",
            "default": true
          },
          "maxTableRows": {
            "title": "Max rows per sheet / CSV",
            "minimum": 10,
            "maximum": 1000000,
            "type": "integer",
            "description": "Read at most this many rows from each XLSX sheet or CSV file.",
            "default": 5000
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Password for protected PDFs. The same password is tried for every PDF in the run."
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Skip files larger than this. Large PDFs need more memory.",
            "default": 50
          },
          "requestTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 5,
            "maximum": 600,
            "type": "integer",
            "description": "Give up on a download after this many seconds. Network errors, 429 and 5xx answers are retried up to 3 times.",
            "default": 60
          },
          "maxConcurrency": {
            "title": "Documents at a time",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many documents to download and read in parallel.",
            "default": 3
          },
          "saveFailuresToDataset": {
            "title": "Save failures to a separate dataset",
            "type": "boolean",
            "description": "Also list failed URLs with the reason in a named dataset called pdf-text-extractor-failures. Failures never go to the main dataset and are never charged; they always appear in the SUMMARY record.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}