{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to JSON Extractor — Tables, Fields & Structure",
    "description": "PDF to JSON API: tables as real rows and columns, headings, paragraphs in true reading order, metadata, form fields and key fields (invoice number, dates, totals, IBAN, VAT). Also outputs Markdown for RAG. Pay per page extracted, capped per document.",
    "version": "1.0",
    "x-build-id": "Y2d0vTAt6zeuLNv3j"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/power_on~pdf-to-json-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-power_on-pdf-to-json-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/power_on~pdf-to-json-extractor/runs": {
      "post": {
        "operationId": "runs-sync-power_on-pdf-to-json-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/power_on~pdf-to-json-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-power_on-pdf-to-json-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": [
          "pdfUrls"
        ],
        "properties": {
          "pdfUrls": {
            "title": "PDF files",
            "minItems": 1,
            "type": "array",
            "description": "Direct links to the PDF files to extract. Accepts a plain URL, an Apify key-value store record URL (upload your file there first), or a base64 data URI (data:application/pdf;base64,...). From the API you can also pass objects: { \"url\": \"...\", \"password\": \"...\", \"name\": \"invoice-42\" }.",
            "default": [
              "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
            ],
            "items": {
              "type": "string"
            }
          },
          "detectTables": {
            "title": "Detect tables",
            "type": "boolean",
            "description": "Find tables and return them as rows and columns instead of a run of text. Works on borderless tables too, because detection is based on how the text lines up rather than on drawn rules.",
            "default": true
          },
          "extractKeyFields": {
            "title": "Extract key fields",
            "type": "boolean",
            "description": "Pull out invoice and order numbers, dates, totals, amounts with their currency, emails, phone numbers, IBANs and VAT IDs. IBANs are checked against the mod-97 checksum and ambiguous dates are flagged rather than guessed.",
            "default": true
          },
          "includeFormFields": {
            "title": "Extract form fields",
            "type": "boolean",
            "description": "Read AcroForm fields — the filled-in boxes of an interactive form — with their names, types and values.",
            "default": true
          },
          "includeLinks": {
            "title": "Extract links",
            "type": "boolean",
            "description": "Collect the hyperlink annotations on each page.",
            "default": true
          },
          "includeLines": {
            "title": "Include raw line geometry",
            "type": "boolean",
            "description": "Add every text line with its bounding box. Useful for building your own layout rules; it makes the output considerably larger.",
            "default": false
          },
          "outputFormats": {
            "title": "Output formats",
            "uniqueItems": true,
            "type": "array",
            "description": "Which files to write to the key-value store. JSON is the full structure; Markdown keeps headings and tables and is the format to feed an LLM; text is the plain reading-order text; CSV holds every detected table.",
            "items": {
              "type": "string",
              "enum": [
                "json",
                "markdown",
                "text",
                "csv"
              ],
              "enumTitles": [
                "JSON — full structure",
                "Markdown — LLM/RAG ready",
                "Plain text",
                "CSV — tables only"
              ]
            },
            "default": [
              "json",
              "markdown"
            ]
          },
          "password": {
            "title": "Password",
            "type": "string",
            "description": "Password for encrypted PDFs, applied to every file that does not carry its own. Leave empty if the documents are not protected."
          },
          "firstPage": {
            "title": "First page",
            "minimum": 1,
            "type": "integer",
            "description": "Page to start from, 1-based.",
            "default": 1
          },
          "maxPages": {
            "title": "Max pages per document",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many pages. 0 reads the whole document. Pages that are not read are not charged.",
            "default": 0
          },
          "inlineFullResult": {
            "title": "Full result inside the dataset row",
            "enum": [
              "auto",
              "always",
              "never"
            ],
            "type": "string",
            "description": "The complete per-page structure is always written to the JSON file. This decides whether it is also embedded in the dataset row. 'Auto' embeds it when the document is small enough for the 9 MB row limit.",
            "default": "auto"
          },
          "concurrency": {
            "title": "Parallel documents",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many PDFs to process at the same time. Raise it for many small files; lower it for very large ones.",
            "default": 3
          },
          "retries": {
            "title": "Retries per file",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries after a network failure. A wrong password, a missing file or a non-PDF response is final and is not retried.",
            "default": 2
          },
          "timeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 5,
            "maximum": 600,
            "type": "integer",
            "description": "How long to wait for a single PDF to download before giving up.",
            "default": 120
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Files larger than this are refused with an explanatory row instead of being downloaded.",
            "default": 100
          },
          "headers": {
            "title": "Extra HTTP headers",
            "type": "object",
            "description": "Sent with every download. Use it for an Authorization header when the PDFs sit behind a private endpoint.",
            "default": {}
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Useful when the host serving the PDFs blocks datacenter addresses.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}