{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Text Extractor — PDF to Text & Markdown, with OCR",
    "description": "PDF to text API: extract the full text of PDFs as plain text and Markdown, one row per PDF with title, author, page count and dates. A parser that reads each page's own text and OCRs scanned pages. Drive, Dropbox and dataset links. Export to JSON, CSV or Excel, or via API.",
    "version": "1.0",
    "x-build-id": "v1qDrlZqJFy8aB7AY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/steadyscrape~pdf-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-steadyscrape-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/steadyscrape~pdf-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-steadyscrape-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/steadyscrape~pdf-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-steadyscrape-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 links",
            "maxItems": 1000,
            "type": "array",
            "description": "Links to your own PDFs, up to 300 MB each: direct links, Google Drive and Dropbox share links (shared with anyone with the link), Google Docs links (exported to PDF) and signed links of Apify key-value records work as they are. Scanned PDFs, TIFF scans and images are read by OCR. Pages of Instagram, TikTok, YouTube and other platforms are refused before anything is downloaded, free.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Or take the PDF links from a dataset",
            "type": "string",
            "description": "Pick the dataset of another run (scraped PDFs, reports, invoices, filings) and every PDF link in it is read. Only the dataset you pick here can be read."
          },
          "datasetFields": {
            "title": "Dataset fields with the links",
            "type": "array",
            "description": "The fields of each dataset item that hold the PDF links, as dotted paths (attachments.url takes the url of every element of attachments). Leave empty to take every link in a field named like pdf, document, file, report, invoice or scan, or ending in .pdf.",
            "items": {
              "type": "string"
            }
          },
          "pdfMode": {
            "title": "PDF pages",
            "enum": [
              "auto",
              "ocr",
              "text-layer-only"
            ],
            "type": "string",
            "description": "A PDF page made by a program (Word, LaTeX, a browser, an invoicing system) carries its own text: <b>auto</b> reads that text exactly and cheaply (the <code>text-page</code> event) and OCRs only scanned pages (the <code>page</code> event). <b>Always OCR</b> reads every page from its picture, for PDFs whose own text is wrong. <b>Own text only</b> never OCRs: scanned pages are left out, free, and named in the document's note.",
            "default": "auto"
          },
          "pages": {
            "title": "Pages",
            "type": "string",
            "description": "Which pages of each PDF or multi-page TIFF to read, like <code>1-3, 5, 10-</code> (10- is page 10 to the end). Empty reads every page, up to the limit below."
          },
          "maxPagesPerFile": {
            "title": "Max pages per PDF",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Pages past this are left out, free, and named in the document's note, so one long PDF cannot spend the whole run.",
            "default": 100
          },
          "script": {
            "title": "OCR language / script",
            "enum": [
              "latin",
              "japanese",
              "korean",
              "cyrillic",
              "arabic",
              "devanagari",
              "thai",
              "greek",
              "tamil",
              "telugu"
            ],
            "type": "string",
            "description": "For scanned pages only (a PDF's own text is read as it is, in any language). One run OCRs one script: the default reads English, Spanish, French, German, Portuguese, Italian, Dutch, the Nordic languages, Indonesian and other Latin-alphabet languages, plus Chinese. Polish, Czech, Romanian and Vietnamese scans lose some accents.",
            "default": "latin"
          },
          "autoRotate": {
            "title": "Fix rotated scans",
            "type": "boolean",
            "description": "Find scanned pages whose text is turned 90, 180 or 270 degrees and OCR them the right way up.",
            "default": true
          },
          "outputFiles": {
            "title": "Also save each PDF as",
            "type": "array",
            "description": "One file per PDF in the run's key-value store, every page in order, linked from its document row by a link that opens for anyone: <b>txt</b> (pages apart by a form feed, as pdftotext writes them), <b>md</b> (Markdown with page headings), <b>json</b> (pages, blocks and lines with their boxes). The document row carries the text and the Markdown either way; a PDF longer than a row holds (1,000,000 characters) gets its .txt and .md saved whatever is chosen here.",
            "items": {
              "type": "string",
              "enum": [
                "txt",
                "md",
                "json"
              ],
              "enumTitles": [
                "Plain text (.txt)",
                "Markdown (.md)",
                "Layout JSON with boxes (.json)"
              ]
            },
            "default": [
              "txt",
              "md"
            ]
          },
          "pageRows": {
            "title": "Also one row per page",
            "type": "boolean",
            "description": "Besides the one row per PDF, a row per page with its text, blocks and lines with boxes, language and how it was read (<code>rowType: \"page\"</code>). Pages are charged the same either way.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}