{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Text & Markdown Converter with OCR (DOCX, Images)",
    "description": "Use this when you need text or LLM-ready Markdown from a PDF, DOCX or image URL, incl. scanned pages (OCR, 27 languages). $0.003/document + $0.0003/text page (first 30) or $0.005/OCR page. Input: {\"url\":\"https://arxiv.org/pdf/1706.03762\"}. Output: markdown, text, pageCount, ocrPages, metadata.",
    "version": "1.0",
    "x-build-id": "PdwDQFTYkfEQoaiX6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/poised_beardlichen~pdf-to-text-markdown-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-poised_beardlichen-pdf-to-text-markdown-ocr",
        "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/poised_beardlichen~pdf-to-text-markdown-ocr/runs": {
      "post": {
        "operationId": "runs-sync-poised_beardlichen-pdf-to-text-markdown-ocr",
        "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/poised_beardlichen~pdf-to-text-markdown-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-poised_beardlichen-pdf-to-text-markdown-ocr",
        "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": {
          "url": {
            "title": "Single document URL (optional)",
            "type": "string",
            "description": "Shortcut for one document URL, e.g. \"https://arxiv.org/pdf/1706.03762\". Combined with the list below; provide at least one of the two."
          },
          "urls": {
            "title": "Document URLs",
            "minItems": 1,
            "maxItems": 10000,
            "type": "array",
            "description": "Direct links to PDF, DOCX or image files (PNG, JPEG, TIFF, WebP, BMP, GIF). Public Google Drive and Dropbox share links are converted automatically. Add as many as you like - they are processed in parallel. Use \"url\" instead for a single item.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "both",
              "markdown",
              "text"
            ],
            "type": "string",
            "description": "Markdown keeps headings, lists and paragraphs (ideal for LLMs, RAG and vector databases). Plain text keeps the original line breaks.",
            "default": "both"
          },
          "outputMode": {
            "title": "One result per",
            "enum": [
              "document",
              "page"
            ],
            "type": "string",
            "description": "Return one dataset item per document, or one item per page with its page number.",
            "default": "document"
          },
          "ocrMode": {
            "title": "OCR (scanned pages)",
            "enum": [
              "auto",
              "always",
              "never"
            ],
            "type": "string",
            "description": "Auto detects scanned or image-only pages (and pages with broken/garbled fonts) and runs OCR only on those. Images are always OCRed.",
            "default": "auto"
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Language(s) of scanned text. Pick 1-3 for best accuracy and speed; English is used if empty.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "fra",
                "spa",
                "ita",
                "por",
                "nld",
                "pol",
                "swe",
                "dan",
                "nor",
                "fin",
                "ces",
                "tur",
                "rus",
                "ukr",
                "ell",
                "ara",
                "heb",
                "hin",
                "vie",
                "ind",
                "tha",
                "chi_sim",
                "chi_tra",
                "jpn",
                "kor"
              ],
              "enumTitles": [
                "English",
                "German",
                "French",
                "Spanish",
                "Italian",
                "Portuguese",
                "Dutch",
                "Polish",
                "Swedish",
                "Danish",
                "Norwegian",
                "Finnish",
                "Czech",
                "Turkish",
                "Russian",
                "Ukrainian",
                "Greek",
                "Arabic",
                "Hebrew",
                "Hindi",
                "Vietnamese",
                "Indonesian",
                "Thai",
                "Chinese (Simplified)",
                "Chinese (Traditional)",
                "Japanese",
                "Korean"
              ]
            },
            "default": [
              "eng"
            ]
          },
          "ocrDpi": {
            "title": "OCR resolution (DPI)",
            "minimum": 100,
            "maximum": 400,
            "type": "integer",
            "description": "Render resolution for OCR. 200 is the best balance; use 300 for tiny print, 150 for large, clean scans.",
            "default": 200
          },
          "maxPagesPerDocument": {
            "title": "Max pages per document",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many pages of each document (0 = all pages). Useful to cap cost on huge files.",
            "default": 0
          },
          "startPage": {
            "title": "Start page",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "First page to extract (PDF only).",
            "default": 1
          },
          "includePages": {
            "title": "Include per-page text",
            "type": "boolean",
            "description": "In document mode, also add a 'pages' array with the text/markdown of every page.",
            "default": false
          },
          "pageMarkers": {
            "title": "Page markers in Markdown",
            "type": "boolean",
            "description": "Insert <!-- page N --> comments into the Markdown so you can cite page numbers.",
            "default": false
          },
          "removeHeadersFooters": {
            "title": "Remove repeating headers & footers",
            "type": "boolean",
            "description": "Drop running heads, footers and page numbers that repeat on most pages.",
            "default": true
          },
          "saveFiles": {
            "title": "Also save .md / .txt files",
            "type": "boolean",
            "description": "Store each document's Markdown and text as files in the key-value store and return download links. Very large documents are always saved as files.",
            "default": false
          },
          "maxFileSizeMb": {
            "title": "Max file size",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger files are skipped (not charged).",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Parallel documents",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many documents to download and convert at the same time.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}