{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Extractor - Text, Tables, Metadata & Links",
    "description": "Extract text, per-page content, metadata, links, outline and best-effort tables from PDF files by URL. Pure pdfjs - no browser, no OCR service, cents per document.",
    "version": "0.1",
    "x-build-id": "8Vv0fVDmbtZFrYVo2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~pdf-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-pdf-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/scrapesage~pdf-extractor/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-pdf-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/scrapesage~pdf-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-pdf-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": {
          "pdfUrls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct links to PDF files, one per line. Each is downloaded and parsed. Duplicates are collapsed. <b>Leave empty and the run returns a small free sample.</b>",
            "items": {
              "type": "string"
            }
          },
          "urlsFromFile": {
            "title": "Import PDF URLs from a file (one per line)",
            "type": "string",
            "description": "Bulk-load PDF links. Either <b>paste the whole list</b> (one URL per line), or give <b>a single link</b> to a public <code>.txt</code>/<code>.csv</code>, a Google Sheet or Drive share link, or an Apify key-value-store record. Blank lines, <code>#</code> comments, CRLF, a UTF-8 BOM, quotes and extra CSV columns all parse. A file that cannot be read says so and charges nothing."
          },
          "extractTables": {
            "title": "Extract tables (best-effort)",
            "type": "boolean",
            "description": "Also reconstruct tabular data into row/column grids from each page's text layout. Best-effort - PDF tables have no standard markup, so results are strongest on ruled/aligned tables. Off by default keeps records lean.",
            "default": false
          },
          "includePageText": {
            "title": "Include per-page text",
            "type": "boolean",
            "description": "Add a <code>pages[]</code> array with each page's text separately, on top of the concatenated <code>text</code> field. Turn off for a leaner record when you only need the full text.",
            "default": true
          },
          "maxPagesPerPdf": {
            "title": "Max pages per PDF",
            "minimum": 0,
            "type": "integer",
            "description": "Cap how many pages to read per document. 0 = all pages. Use a small number to sample the start of very large PDFs cheaply.",
            "default": 0
          },
          "maxPdfMb": {
            "title": "Max PDF size (MB)",
            "minimum": 1,
            "type": "integer",
            "description": "Skip any file larger than this. Protects a run from a single huge download. A skipped file is reported, not charged extra.",
            "default": 50
          },
          "outputFields": {
            "title": "Output fields (leave empty for all)",
            "type": "array",
            "description": "Pick the fields you want and every record is trimmed to exactly those - handy for lean CSV/Sheets exports. <b>Nothing to memorise:</b> open the dropdown and tick, or start typing (<code>text</code>, <code>title</code>, <code>tables</code>) to filter.",
            "items": {
              "type": "string",
              "enum": [
                "type",
                "url",
                "filename",
                "status",
                "error",
                "sizeBytes",
                "pageCount",
                "title",
                "author",
                "subject",
                "keywords",
                "creator",
                "producer",
                "pdfVersion",
                "isEncrypted",
                "creationDate",
                "modificationDate",
                "text",
                "wordCount",
                "charCount",
                "pages",
                "links",
                "linkCount",
                "outline",
                "tables",
                "scrapedAt"
              ],
              "enumTitles": [
                "Record type (type)",
                "PDF URL (url)",
                "Filename (filename)",
                "Status (status)",
                "Error (error)",
                "Size in bytes (sizeBytes)",
                "Page count (pageCount)",
                "Title (title)",
                "Author (author)",
                "Subject (subject)",
                "Keywords (keywords)",
                "Creator app (creator)",
                "Producer app (producer)",
                "PDF version (pdfVersion)",
                "Is encrypted (isEncrypted)",
                "Creation date (creationDate)",
                "Modified date (modificationDate)",
                "Full text (text)",
                "Word count (wordCount)",
                "Character count (charCount)",
                "Per-page text (pages)",
                "Links (links)",
                "Link count (linkCount)",
                "Outline / bookmarks (outline)",
                "Tables (tables)",
                "Scraped at (scrapedAt)"
              ]
            }
          },
          "maxItems": {
            "title": "Max PDFs",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of PDFs to process in one run (after de-duplication).",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. PDF files are usually public, so no proxy is needed by default. Enable a proxy only if a host blocks the downloader (e.g. returns 403)."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}