{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Text Extractor: Pages, Tables, Markdown & Metadata",
    "description": "Extract text from PDF URLs, uploads or dataset links: one row per document or per page, page ranges, table-friendly layout order, Markdown and metadata. Password-protected and scanned PDFs are detected and never charged. No OCR, no proxy.",
    "version": "0.1",
    "x-build-id": "uNv0hjYs1cFVdis2g"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ctriolab~pdf-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ctriolab-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/ctriolab~pdf-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-ctriolab-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/ctriolab~pdf-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-ctriolab-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": {
          "urls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct links to PDF files (http or https). Duplicates are skipped. A URL that is not a PDF, returns an error or times out is reported in the run SUMMARY and is not charged.",
            "items": {
              "type": "string"
            }
          },
          "uploadedFile": {
            "title": "Or upload a PDF",
            "type": "string",
            "description": "Upload one PDF from your computer. It is processed together with the URLs above."
          },
          "datasetId": {
            "title": "Or read URLs from a dataset",
            "type": "string",
            "description": "An Apify dataset (for example from a scraper run) that has PDF links. In an integration after another Actor use {{resource.defaultDatasetId}}."
          },
          "urlField": {
            "title": "URL field in that dataset",
            "type": "string",
            "description": "Name of the field that holds the PDF link in each dataset item.",
            "default": "url"
          },
          "outputMode": {
            "title": "One row per",
            "enum": [
              "document",
              "page"
            ],
            "type": "string",
            "description": "Each result row is one charged item. Document rows also list every page with its character count, so you can still see which pages are empty. Page mode skips pages without text (not charged).",
            "default": "document"
          },
          "pages": {
            "title": "Pages",
            "type": "string",
            "description": "Optional page selection, e.g. 1-3, 7, 10- (10 to the end). Empty: all pages."
          },
          "textLayout": {
            "title": "Text order",
            "enum": [
              "reading",
              "layout"
            ],
            "type": "string",
            "description": "Reading order follows the PDF and keeps two-column papers in column order. Layout order sorts text top to bottom and left to right, so table rows stay on one line even when the PDF stores the table column by column.",
            "default": "reading"
          },
          "markdown": {
            "title": "Markdown",
            "type": "boolean",
            "description": "Also return a Markdown-like version: headings from larger fonts, bullet lists, wrapped lines joined into paragraphs, tab rows (layout mode) as Markdown tables. Handy for LLM and RAG input.",
            "default": false
          },
          "includeText": {
            "title": "Include plain text",
            "type": "boolean",
            "description": "Turn off to get only Markdown (with Markdown on) and smaller rows.",
            "default": true
          },
          "maxChars": {
            "title": "Max characters per row",
            "minimum": 0,
            "type": "integer",
            "description": "Cut text and Markdown at this length (0 = no limit). In document mode reading stops once the limit is reached, which saves time on long files. Rows that were cut have truncated: true.",
            "default": 0
          },
          "password": {
            "title": "PDF password",
            "type": "string",
            "description": "Only for password-protected PDFs. Without it such PDFs are reported as \"password protected\" and not charged."
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger files are skipped (reported, not charged). The download is streamed and stopped as soon as the limit is passed.",
            "default": 100
          },
          "downloadTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 5,
            "maximum": 900,
            "type": "integer",
            "description": "Per file.",
            "default": 120
          },
          "maxConcurrency": {
            "title": "PDFs at the same time",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many PDFs are downloaded and read in parallel. Use more memory for higher values with large files.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}