{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Text & Markdown with OCR for Scans (19 Languages)",
    "description": "Convert PDFs to clean Markdown and plain text. Digital pages are read exactly from the text layer; scans, phone photos and skewed or sideways pages are cleaned up and read with OCR in 19 languages (auto-detected). Tables, form fields and RAG chunks included.",
    "version": "0.1",
    "x-build-id": "LDpIWtSywAILTdZiI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/prime619~pdf-to-text-markdown-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-prime619-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/prime619~pdf-to-text-markdown-ocr/runs": {
      "post": {
        "operationId": "runs-sync-prime619-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/prime619~pdf-to-text-markdown-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-prime619-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",
        "required": [
          "pdfUrls"
        ],
        "properties": {
          "pdfUrls": {
            "title": "PDF files",
            "type": "array",
            "description": "Direct links to PDF files (up to 500 per run). Google Drive and Dropbox share links are converted to their direct-download form. The files must be publicly downloadable; this Actor does not log in anywhere. Only process files you have the right to use.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "both",
              "markdown",
              "text"
            ],
            "type": "string",
            "description": "Markdown keeps headings, lists and tables, which works well for LLMs and RAG. Plain text has no markup.",
            "default": "both"
          },
          "ocrMode": {
            "title": "OCR",
            "enum": [
              "auto",
              "off",
              "force"
            ],
            "type": "string",
            "description": "Auto reads the PDF's own text where it exists and runs OCR only on scanned pages (and on pages whose text layer is garbled). OCR pages cost more than text pages.",
            "default": "auto"
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Leave empty to detect the language automatically (script detection plus a language guess; German pages that read badly are retried with the Fraktur model for historic print). Set it when you know the language: it is faster and more accurate. Up to 3; each extra language makes OCR slower.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "deu",
                "spa",
                "por",
                "fra",
                "ita",
                "nld",
                "pol",
                "tur",
                "ind",
                "vie",
                "rus",
                "ukr",
                "ara",
                "hin",
                "ben",
                "jpn",
                "chi_sim",
                "kor",
                "frk"
              ],
              "enumTitles": [
                "English",
                "German",
                "Spanish",
                "Portuguese",
                "French",
                "Italian",
                "Dutch",
                "Polish",
                "Turkish",
                "Indonesian",
                "Vietnamese",
                "Russian",
                "Ukrainian",
                "Arabic",
                "Hindi",
                "Bengali",
                "Japanese",
                "Chinese (Simplified)",
                "Korean",
                "German Fraktur (historic print)"
              ]
            },
            "default": []
          },
          "pageRange": {
            "title": "Pages",
            "type": "string",
            "description": "Optional, for example 1-5,8,10- . Empty means all pages.",
            "default": ""
          },
          "maxPagesPerPdf": {
            "title": "Maximum pages per PDF",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Pages beyond this are skipped (and not charged). Protects you from unexpectedly long files.",
            "default": 300
          },
          "extractTables": {
            "title": "Extract tables",
            "type": "boolean",
            "description": "Turn ruled tables in text-layer pages into Markdown tables. Tables on scanned pages come out as text.",
            "default": true
          },
          "chunkForRag": {
            "title": "Split into chunks for RAG",
            "type": "boolean",
            "description": "Adds a 'chunks' array: overlapping pieces with page numbers and the heading path, ready for embeddings.",
            "default": false
          },
          "chunkSizeChars": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum characters per chunk.",
            "default": 2000
          },
          "chunkOverlapChars": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Characters repeated from the end of the previous chunk.",
            "default": 200
          },
          "includePages": {
            "title": "Include per-page results",
            "type": "boolean",
            "description": "Adds a 'pages' array with the Markdown, method (text or OCR) and OCR confidence of every page.",
            "default": false
          },
          "cleanScans": {
            "title": "Clean up scans before OCR",
            "type": "boolean",
            "description": "Evens out uneven lighting (phone photos, shadows), straightens skewed pages, removes speckles, and turns sideways pages upright. Leave it on unless very small print comes out broken.",
            "default": true
          },
          "onlyNewFiles": {
            "title": "Only new files",
            "type": "boolean",
            "description": "Skip files (by content hash) that an earlier run with the same state name already processed. Skipped files are not charged. Useful for scheduled runs over a folder of links.",
            "default": false
          },
          "stateName": {
            "title": "State name",
            "type": "string",
            "description": "Name for the 'Only new files' memory, so different schedules do not share it.",
            "default": ""
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}