{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Text Extractor – Text, Markdown, Tables & OCR",
    "description": "Extract text, Markdown and tables (CSV) from your PDFs. OCR for scanned PDFs in English, Dutch, French, German, Spanish, Italian, Portuguese. No API key. From $4 per 1,000 PDFs.",
    "version": "0.1",
    "x-build-id": "8hUhCSeiKB1f77Her"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/olliolli~pdf-text-extractor-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-olliolli-pdf-text-extractor-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/olliolli~pdf-text-extractor-ocr/runs": {
      "post": {
        "operationId": "runs-sync-olliolli-pdf-text-extractor-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/olliolli~pdf-text-extractor-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-olliolli-pdf-text-extractor-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": {
          "urls": {
            "title": "PDF links",
            "type": "array",
            "description": "Direct links to PDF files. Share links from Google Drive, Dropbox, OneDrive and SharePoint are converted to download links automatically (set sharing to \"Anyone with the link\"). Web pages are not supported: the link must open the PDF itself.",
            "items": {
              "type": "string"
            }
          },
          "uploadedFiles": {
            "title": "Upload PDFs",
            "type": "array",
            "description": "Upload PDF files from your computer. They are stored in a key-value store of your Apify account and read from there."
          },
          "base64Pdfs": {
            "title": "PDFs as base64 (API)",
            "type": "array",
            "description": "For API use: a list of {\"name\": \"file.pdf\", \"data\": \"<base64>\"} objects. Maximum 25 MB per file. A data: URL is accepted too."
          },
          "datasetId": {
            "title": "Dataset with PDF links",
            "type": "string",
            "description": "Process the PDF links found in a dataset, for example the output of another actor. Pick the dataset here so this actor gets read access to it."
          },
          "urlField": {
            "title": "Link field in the dataset",
            "type": "string",
            "description": "Field of each dataset item that holds the PDF link. Use a dot for nested fields (e.g. \"document.pdfUrl\"). A field with a list of links is fine too.",
            "default": "url"
          },
          "pdfPassword": {
            "title": "PDF password",
            "type": "string",
            "description": "Password for protected PDFs (tried on every file). It is never written to the log or the output."
          },
          "outputs": {
            "title": "What to extract",
            "type": "array",
            "description": "Plain text, Markdown (headings, paragraphs and tables), tables as rows and CSV, and/or the text per page.",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "markdown",
                "tables",
                "perPage"
              ],
              "enumTitles": [
                "Plain text",
                "Markdown",
                "Tables (rows + CSV)",
                "Text per page"
              ]
            },
            "default": [
              "text",
              "markdown",
              "tables"
            ]
          },
          "ocr": {
            "title": "OCR for scanned pages",
            "enum": [
              "auto",
              "off",
              "force"
            ],
            "type": "string",
            "description": "Auto: read pages without a text layer (fewer than 40 characters) with OCR. Force: OCR every page. Off: text layer only.",
            "default": "auto"
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "array",
            "description": "Languages in your scans. Fewer languages is a little faster and more accurate.",
            "items": {
              "type": "string",
              "enum": [
                "eng",
                "nld",
                "fra",
                "deu",
                "spa",
                "ita",
                "por"
              ],
              "enumTitles": [
                "English",
                "Dutch",
                "French",
                "German",
                "Spanish",
                "Italian",
                "Portuguese"
              ]
            },
            "default": [
              "eng",
              "nld",
              "fra",
              "deu"
            ]
          },
          "maxPages": {
            "title": "Max pages per PDF",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Pages after this number are skipped (the row gets status \"partial\").",
            "default": 200
          },
          "maxOcrPagesPerPdf": {
            "title": "Max OCR pages per PDF",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Upper limit for paid OCR pages per PDF. Pages over the limit are left without OCR (status \"partial\").",
            "default": 50
          },
          "maxPdfSizeMb": {
            "title": "Max PDF size",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger files are not downloaded and not charged.",
            "default": 100
          },
          "timeoutPerPdfSecs": {
            "title": "Time limit per PDF",
            "minimum": 10,
            "maximum": 1800,
            "type": "integer",
            "description": "Reading a PDF stops after this time. Pages already read are delivered (status \"partial\").",
            "default": 120
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}