{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Text Extractor: PDF and Image to Text, with OCR",
    "description": "Turn PDFs and images into clean text and Markdown for AI, RAG and search. Paste links (Google Drive and Dropbox too) or a page that links to PDFs. Get headings, pages, chunks, links, form fields and metadata. OCR for scans and images. $4 per 1,000 PDFs.",
    "version": "0.1",
    "x-build-id": "vx2Mzm3C8WiJR4MzV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vindr~pdf-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vindr-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/vindr~pdf-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-vindr-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/vindr~pdf-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-vindr-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": {
          "urls": {
            "title": "PDF or image URLs, or web pages",
            "type": "array",
            "description": "Links to PDF files or images, one per line. Google Drive and Dropbox share links work too (the file must be shared with anyone who has the link). You can also add a web page: the PDFs it links to are found and extracted (see <b>Max PDFs per web page</b>). Images need <b>Read scanned pages and images (OCR)</b> turned on.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "both",
              "markdown",
              "text"
            ],
            "type": "string",
            "description": "<b>Markdown</b> keeps headings and lists, which works best for AI and RAG. <b>Plain text</b> is clean paragraphs without formatting.",
            "default": "both"
          },
          "splitBy": {
            "title": "Split output by",
            "enum": [
              "document",
              "page",
              "chunk"
            ],
            "type": "string",
            "description": "<b>Document</b>: one item per PDF with all its text. <b>Page</b>: one item per page. <b>Chunk</b>: text split into pieces of about <b>Chunk size</b> characters, ready for embeddings and RAG. You pay per PDF either way.",
            "default": "document"
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 20000,
            "type": "integer",
            "description": "Only for <b>Split output by: Chunk</b>. About 4 characters make one token, so 2,000 characters are roughly 500 tokens. Paragraphs are only cut when they are longer than a chunk.",
            "default": 2000
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Only for chunks: how much text from the end of one chunk is repeated at the start of the next, so no sentence loses its context.",
            "default": 200
          },
          "includePages": {
            "title": "Also include the text of each page",
            "type": "boolean",
            "description": "Only for <b>Split output by: Document</b>: add a list with the text of every page to each document item.",
            "default": false
          },
          "removeHeadersFooters": {
            "title": "Remove headers, footers and page numbers",
            "type": "boolean",
            "description": "Leave out lines that repeat at the top or bottom of many pages, like running titles and \"Page 3 of 10\". Recommended for AI and search.",
            "default": true
          },
          "ocr": {
            "title": "Read scanned pages and images (OCR)",
            "type": "boolean",
            "description": "Read pages that have no text layer, like scanned documents, and image files (PNG, JPEG, WebP, GIF, BMP) with OCR. Only pages without text are read this way, and each OCR page or image is charged separately (see the README). OCR takes a few seconds per page.",
            "default": false
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "The languages in your scanned documents and images. Pick only the ones you need: more languages make OCR slower.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "nor",
                "swe",
                "dan",
                "fin",
                "deu",
                "fra",
                "spa",
                "ita",
                "nld",
                "por",
                "pol"
              ],
              "enumTitles": [
                "English",
                "Norwegian",
                "Swedish",
                "Danish",
                "Finnish",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Dutch",
                "Portuguese",
                "Polish"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "pageRange": {
            "title": "Pages",
            "type": "string",
            "description": "Only extract these pages, for example <code>1-5, 8, 12-</code>. Leave empty for all pages."
          },
          "password": {
            "title": "PDF password",
            "type": "string",
            "description": "For password-protected PDFs. The same password is tried for every file."
          },
          "maxPdfsPerPage": {
            "title": "Max PDFs per web page",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "When you give a web page instead of a PDF, extract at most this many of the PDFs it links to. Only links that end in .pdf are followed, and the site's robots.txt is respected.",
            "default": 20
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Skip PDFs larger than this.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many PDFs to download and read at the same time.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}