{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Text & Markdown Extractor",
    "description": "Give it PDF URLs, get clean text, Markdown and metadata for each one, ready for LLM and RAG pipelines. Reading order, columns, headings, lists, links and bookmarks are rebuilt. No OCR. You pay only for PDFs whose text was extracted.",
    "version": "0.1",
    "x-build-id": "A8M2dtQcAaAFG4enM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/far003~pdf-to-text-markdown-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-far003-pdf-to-text-markdown-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/far003~pdf-to-text-markdown-extractor/runs": {
      "post": {
        "operationId": "runs-sync-far003-pdf-to-text-markdown-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/far003~pdf-to-text-markdown-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-far003-pdf-to-text-markdown-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 URLs",
            "minItems": 1,
            "type": "array",
            "description": "Addresses of PDF files (http or https). One record per address. Addresses that are not usable web addresses, or point to private/local networks, get an \"invalid\" record (free), not a run error. Credentials written inside a URL are removed and never used.",
            "items": {
              "type": "string"
            }
          },
          "outputFormats": {
            "title": "Output formats",
            "type": "array",
            "description": "\"text\" is clean plain text, \"markdown\" adds headings, lists, tables (best effort), links and code blocks. Both by default.",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "markdown"
              ],
              "enumTitles": [
                "Plain text",
                "Markdown"
              ]
            },
            "default": [
              "text",
              "markdown"
            ]
          },
          "includePages": {
            "title": "Text per page",
            "type": "boolean",
            "description": "Add pages[] to each record with the text of every page, and <!-- page N --> markers in the Markdown.",
            "default": false
          },
          "pageRange": {
            "title": "Pages to read",
            "type": "string",
            "description": "For example 1-5,8 or 3- (from page 3 to the end). Empty = all pages."
          },
          "maxPagesPerDocument": {
            "title": "Maximum pages per document (0 = all)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Read at most this many pages of each PDF (after the page range). Hard limit 5,000.",
            "default": 0
          },
          "keepHeadersFooters": {
            "title": "Keep repeated headers, footers and page numbers",
            "type": "boolean",
            "description": "By default the lines that repeat at the top or bottom of at least half of the pages (page numbers included), and the running heads of a chapter (the same line on 5 or more pages in a row, or on every other page, or whose page number is part of the line: \"12 Chapter 3. Functions\"), and margin stamps turned against the page that repeat on half of the pages, are left out of the text and the Markdown. Turn this on to keep them. Never applied to documents of fewer than 4 pages.",
            "default": false
          },
          "onlyChanged": {
            "title": "Only changed PDFs",
            "type": "boolean",
            "description": "Remember each PDF between runs (ETag, Last-Modified and a SHA-256 of the file). A PDF that has not changed gets a free \"unchanged\" record without text, and when the server supports it the file is not even downloaded. Only what was delivered is remembered.",
            "default": false
          },
          "maxPdfMegabytes": {
            "title": "Maximum PDF size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Larger files are not read (free, status too_large). The download is stopped as soon as the limit is passed. Every PDF is held in memory while it is read (several times its size) and several are read at once: up to 100 MB fits the default memory of 1,024 MB with a low \"PDFs at the same time\"; raise the memory of the run before you raise the concurrency.",
            "default": 50
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Check the robots.txt of the site every PDF (and every redirect) comes from. PDFs it forbids are not downloaded (free, status blocked).",
            "default": true
          },
          "requestsPerSecond": {
            "title": "Requests per second, per host",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Politeness limit for each host. A Crawl-delay in robots.txt can only slow it down.",
            "default": 2
          },
          "maxConcurrency": {
            "title": "PDFs processed at the same time",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "Each PDF is held in memory while it is read. With very large files, lower this or raise the memory of the run.",
            "default": 4
          },
          "timeoutSecs": {
            "title": "Time limit per PDF (seconds)",
            "minimum": 5,
            "maximum": 600,
            "type": "integer",
            "description": "Download plus extraction. Also the longest silence allowed while a file arrives.",
            "default": 60
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}