{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Text Extractor - Bulk PDF URLs & Datasets to Text",
    "description": "Extract text from public PDF URLs in bulk, from another Actor's Dataset, an upload or base64. Per-page text, SHA-256 and a status per file for n8n, Make, AI agents and RAG. No OCR. Extract only documents you may read; it does not bypass logins, paywalls, CAPTCHAs or other access controls.",
    "version": "0.1",
    "x-build-id": "s4xVtbwgxSkQehHVT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automa-flow~pdf-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automa-flow-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/automa-flow~pdf-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-automa-flow-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/automa-flow~pdf-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-automa-flow-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",
            "minItems": 0,
            "maxItems": 200,
            "type": "array",
            "description": "Public http:// or https:// PDF URLs. Leave this an empty array when you only upload a file or send base64. Ignored when Source Dataset is set. The Console prefill is one short public sample PDF.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048,
              "pattern": "^https?://\\S+$"
            },
            "default": [
              "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
            ]
          },
          "datasetId": {
            "title": "Source Dataset",
            "pattern": "^(?:[A-Za-z0-9]{17})?$",
            "type": "string",
            "description": "The Dataset of a finished crawler, scraper or API run whose rows hold PDF links. Takes priority over PDF URLs. Reads up to 200 rows per run. Cannot be combined with an upload or base64."
          },
          "urlField": {
            "title": "PDF URL field in Dataset",
            "pattern": "^[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)*$",
            "maxLength": 200,
            "type": "string",
            "description": "The column that holds the PDF link, for example url, pdfUrl or document.url. Rows without a value are skipped and not charged.",
            "default": "url"
          },
          "datasetOffset": {
            "title": "Dataset start row",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Zero-based row to start from. For a Dataset over 200 rows, run again with nextDatasetOffset from RUN_SUMMARY.",
            "default": 0
          },
          "base64Pdfs": {
            "title": "Base64 PDFs",
            "maxItems": 32,
            "type": "array",
            "description": "PDF files as standard base64, or as data:application/pdf;base64,... URLs. Each item needs a filename and the payload. At most 32 files, so the batch fits in the default 1024 MB. A larger batch should be public URLs or the single upload.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "filename",
                "data"
              ],
              "properties": {
                "filename": {
                  "type": "string",
                  "title": "File name",
                  "description": "Name stored on the result row. Path segments are removed.",
                  "editor": "textfield",
                  "minLength": 1,
                  "maxLength": 255
                },
                "data": {
                  "type": "string",
                  "title": "Base64 data",
                  "description": "Base64 of the PDF bytes, without a line-length limit. A data URL prefix is accepted.",
                  "editor": "textarea",
                  "minLength": 1,
                  "maxLength": 7340032
                }
              }
            }
          },
          "pdfFile": {
            "title": "PDF upload",
            "maxLength": 2048,
            "type": "string",
            "description": "One PDF file. On Apify this is the uploaded-file URL. Omit it when you are not uploading."
          },
          "includePages": {
            "title": "Include per-page text",
            "type": "boolean",
            "description": "When true, each SUCCESS row includes a pages array. Turn it off to keep large runs smaller.",
            "default": true
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Reject a document larger than this size. The ceiling is 5 MB until Cloud cost measurements say otherwise.",
            "default": 5
          },
          "maxPagesPerPdf": {
            "title": "Max pages per PDF",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Reject a PDF with more pages than this. The ceiling is 500 until Cloud cost measurements say otherwise.",
            "default": 500
          },
          "payload": {
            "title": "Integration payload",
            "type": "object",
            "description": "Added by an Apify Actor-to-Actor integration. It is accepted so the run can start and is not read. Set datasetId to {{resource.defaultDatasetId}} in the integration input."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}