{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF to Markdown - Text, Tables, CJK-safe",
    "description": "PDF URLs to RAG-ready Markdown, text or chunks with page refs. Headings, lists, tables, header/footer removal, Korean/Japanese/Chinese safe. $0.003 per PDF up to 50 pages, only when it works. No OCR: scans are flagged, free.",
    "version": "0.1",
    "x-build-id": "9RqXCyYcwcnGnZF3r"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/teal_blacksmith~pdf-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-teal_blacksmith-pdf-to-markdown",
        "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/teal_blacksmith~pdf-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-teal_blacksmith-pdf-to-markdown",
        "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/teal_blacksmith~pdf-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-teal_blacksmith-pdf-to-markdown",
        "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 URLs",
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "description": "Up to 500 public http(s) URLs of PDF files. Redirects are followed (each hop is checked again). URLs that point to private or internal addresses, use a custom port, or contain credentials are refused and not charged. The same URL listed twice is converted and charged once.",
            "items": {
              "type": "string"
            }
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "markdown",
              "text",
              "chunks"
            ],
            "type": "string",
            "description": "markdown: one Markdown string with headings, lists and tables. text: the same reading order as plain text. chunks: the Markdown split into chunks of about chunkSize tokens, each with its page range and heading path. The price is the same for all modes.",
            "default": "markdown"
          },
          "chunkSize": {
            "title": "Chunk size (tokens, estimated)",
            "minimum": 100,
            "maximum": 4000,
            "type": "integer",
            "description": "Target size of one chunk in estimated tokens (about 4 Latin characters, or 1 Korean/Japanese/Chinese character, per token). It is an estimate, not the count of a specific tokenizer. Used only when outputMode is chunks.",
            "default": 800
          },
          "pageRange": {
            "title": "Page range",
            "type": "string",
            "description": "Optional pages to convert, for example \"1-5,8,10-\". Empty means all pages, up to maxPages. A range that selects no page of the PDF gives status parse_error."
          },
          "maxPages": {
            "title": "Max pages per PDF",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Most pages converted per PDF. The first 50 pages are included in the PDF price. If you raise this above 50, every started block of 10 pages beyond 50 costs an extra $0.0005 (event extra-pages-10). With the default of 50 no extra charge can occur; a longer PDF is cut at 50 pages and the row says truncated: true.",
            "default": 50
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Larger files are not parsed and get status too_large (free). The download stops as soon as the limit is passed.",
            "default": 30
          },
          "includePages": {
            "title": "Include per-page text",
            "type": "boolean",
            "description": "Adds a pages array with the plain text of each page. Per-page statistics (characters, garbledRatio, hasText) are always included.",
            "default": false
          },
          "removeHeadersFooters": {
            "title": "Remove repeated headers and footers",
            "type": "boolean",
            "description": "Drops lines in the top or bottom margin that repeat on at least 40% of the pages (needs 3 or more pages). Bare page numbers in the margin are always dropped.",
            "default": true
          },
          "detectTables": {
            "title": "Detect simple tables",
            "type": "boolean",
            "description": "Turns text laid out in aligned columns into Markdown tables. It uses text positions only: ruled tables without text alignment, merged cells and cells that wrap over several lines are not reliable.",
            "default": true
          },
          "pageMarkers": {
            "title": "Page markers in Markdown",
            "type": "boolean",
            "description": "Inserts an HTML comment such as <!-- page 3 --> where a page begins in the Markdown output.",
            "default": false
          },
          "timeoutPerPdfSecs": {
            "title": "Time limit per PDF (seconds)",
            "minimum": 10,
            "maximum": 600,
            "type": "integer",
            "description": "Download and conversion of one PDF must finish within this time. Otherwise the row gets status timeout and is not charged.",
            "default": 120
          },
          "maxConcurrency": {
            "title": "Downloads in parallel",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "How many PDFs are downloaded at the same time. Parsing itself runs one PDF at a time to keep memory bounded.",
            "default": 2
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}