{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Text & Markdown: Extract Text from PDF, RAG Chunks",
    "description": "Extract text from PDF URLs or uploads: PDF to text and markdown with page markers, metadata and RAG chunks. $2.50 per 1,000 PDFs. Text PDFs only; scans free.",
    "version": "0.1",
    "x-build-id": "ITDtz3YdKvOGZvsBF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ataism~pdf-to-text/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ataism-pdf-to-text",
        "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/ataism~pdf-to-text/runs": {
      "post": {
        "operationId": "runs-sync-ataism-pdf-to-text",
        "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/ataism~pdf-to-text/run-sync": {
      "post": {
        "operationId": "run-sync-ataism-pdf-to-text",
        "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": {
          "pdfUrls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct http(s) links to PDF files, one per entry, e.g. [\"https://example.com/report.pdf\"]. Each PDF becomes one row. Costs $0.0025 per PDF converted (status ok), per PDF not per page; scans, encrypted files and failed downloads are free. Private, local and internal addresses are blocked. At most 5,000 per run. To use a file from your computer, upload it with Uploaded PDF files or save it to a key-value store and paste its record URL here.",
            "items": {
              "type": "string"
            }
          },
          "pdfFiles": {
            "title": "Uploaded PDF files",
            "type": "array",
            "description": "Optional. PDFs uploaded from your computer to a key-value store of your choice (the Console editor offers this), or pasted record URLs, e.g. [{\"url\": \"https://api.apify.com/v2/key-value-stores/STORE_ID/records/report.pdf\"}]. Same price and limits as PDF URLs. The Actor reads each file once and stores nothing. API callers can simply put those record URLs in PDF URLs."
          },
          "pageRange": {
            "title": "Page range",
            "type": "string",
            "description": "Only convert these pages, e.g. \"1-5,8\" or \"3-\" (page 3 to the end). Leave empty for all pages. Applies to every PDF. Does not change the price."
          },
          "maxPages": {
            "title": "Max pages per PDF",
            "minimum": 1,
            "type": "integer",
            "description": "Convert only the first N pages of each PDF (after the page range), e.g. 20. Default 100, minimum 1; a value above 500 is lowered to 500 with a warning. Cut documents are marked \"truncated\": true. The price is per PDF, not per page.",
            "default": 100
          },
          "includeText": {
            "title": "Include plain text",
            "type": "boolean",
            "description": "true (default): add the \"text\" field (plain text). false: omit it to shrink rows. No change to price.",
            "default": true
          },
          "includeMarkdown": {
            "title": "Include markdown",
            "type": "boolean",
            "description": "true (default): add the \"markdown\" field: headings (guessed from font size), bullet lists, page markers (<!-- page N -->) and --- between pages. false: omit it. No change to price.",
            "default": true
          },
          "includePages": {
            "title": "Include per-page text",
            "type": "boolean",
            "description": "true: add a \"pages\" array with the text of each page (objects with page, text, markdown, charCount). Makes rows larger. false (default): no per-page array. No change to price.",
            "default": false
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Split the text into chunks of about this many characters for search or RAG, e.g. 1000, cutting at paragraph, sentence or word boundaries; returned in \"chunks\" with page numbers. 0 (default) turns chunks off; otherwise at least 200, maximum 20,000. No extra charge.",
            "default": 0
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Characters repeated at the start of the next chunk, e.g. 150. Default 100, maximum 10,000; capped at half the chunk size. Only used when Chunk size is above 0.",
            "default": 100
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Largest PDF to download, in MB, e.g. 20. Larger files are skipped with an error row (not charged). Default 50, hard cap 100. Several large files at once need more run memory; the Actor lowers concurrency to fit.",
            "default": 50
          },
          "downloadTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "Time allowed to download each file in seconds, including redirects, e.g. 60. Default 60, minimum 5, maximum 300. Files that time out are free error rows.",
            "default": 60
          },
          "concurrency": {
            "title": "Parallel PDFs",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many PDFs are processed at once, e.g. 3. Default 3, minimum 1, maximum 5. Lowered automatically when the run memory is small for the file size.",
            "default": 3
          },
          "mode": {
            "title": "Mode",
            "type": "string",
            "description": "Internal: \"selfTest\" runs the maintainer health check and saves no items. Leave as \"run\" (the default).",
            "default": "run"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}