{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Text Extractor - Bulk PDF to Text, Metadata & Search",
    "description": "Extract text and metadata from PDFs in bulk: give PDF URLs or web pages that link to PDFs. Get full text or one item per page, title, author, dates, page and word counts, keyword hits with page numbers and snippets, and a flag for scanned PDFs. Ideal for RAG, LLM and research pipelines.",
    "version": "1.0",
    "x-build-id": "GipzdSfqrMY2vlpYf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/paperlinenstudio~pdf-text-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-paperlinenstudio-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/paperlinenstudio~pdf-text-extractor/runs": {
      "post": {
        "operationId": "runs-sync-paperlinenstudio-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/paperlinenstudio~pdf-text-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-paperlinenstudio-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",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "PDF or web page URLs",
            "type": "array",
            "description": "Direct links to PDF files, or web pages that link to PDFs (e.g. a report archive or a downloads page). For web pages the linked PDFs are found and extracted (see 'Find PDFs linked from web pages'). Duplicates are removed.",
            "items": {
              "type": "string"
            }
          },
          "searchTerms": {
            "title": "Search terms (optional)",
            "type": "array",
            "description": "Words or phrases to find in each PDF (case-insensitive, whole words). Each hit is returned with the page number and a text snippet. Prefix with re: for a regular expression, e.g. re:\\d{2}\\.\\d{2}\\.\\d{4}.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyMatching": {
            "title": "Only return PDFs that contain a search term",
            "type": "boolean",
            "description": "Skip PDFs (or pages in page mode) without any search-term hit. Skipped PDFs are not charged.",
            "default": false
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "document",
              "page"
            ],
            "type": "string",
            "description": "Return one dataset item per PDF, or one item per page with its page number.",
            "default": "document"
          },
          "findPdfLinks": {
            "title": "Find PDFs linked from web pages",
            "type": "boolean",
            "description": "If a URL is a web page instead of a PDF, extract the PDFs it links to (links ending in .pdf, embeds and iframes).",
            "default": true
          },
          "sameSiteOnly": {
            "title": "Only PDFs on the same website",
            "type": "boolean",
            "description": "When scanning a web page, ignore PDF links pointing to other domains.",
            "default": false
          },
          "maxPdfsPerPage": {
            "title": "Max PDFs per web page",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of linked PDFs to extract from each web page.",
            "default": 20
          },
          "maxPagesPerPdf": {
            "title": "Max pages per PDF",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Only read the first N pages of each PDF (0 = all pages). Useful for huge reports where only the summary matters.",
            "default": 0
          },
          "maxTextLength": {
            "title": "Max text length per item (characters)",
            "minimum": 0,
            "maximum": 5000000,
            "type": "integer",
            "description": "Truncate the text field to this many characters (0 = no limit). The full length is still reported in textLength.",
            "default": 100000
          },
          "cleanText": {
            "title": "Clean text",
            "type": "boolean",
            "description": "Join hyphenated line breaks, remove soft hyphens and collapse repeated spaces and blank lines.",
            "default": true
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Skip PDFs larger than this.",
            "default": 50
          },
          "maxItems": {
            "title": "Max PDFs",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many PDFs (successful + failed).",
            "default": 1000
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many PDFs are downloaded in parallel.",
            "default": 5
          },
          "timeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 5,
            "maximum": 600,
            "type": "integer",
            "description": "Timeout for each download.",
            "default": 60
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Do not scan web pages or download linked PDFs that the site's robots.txt disallows. Direct PDF URLs you enter are always fetched.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}