{
  "openapi": "3.0.1",
  "info": {
    "title": "Scanned PDF OCR to RAG Chunks: Image to Text + Page Citations",
    "description": "OCR scanned PDFs and images in 24 languages and split the text into RAG chunks with page numbers and a quality score per page. $1.50 per 1,000 pages with usable text; blank pages are free.",
    "version": "0.4",
    "x-build-id": "UbJ86AMeEuhGU4jef"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/skilled_glee~ocr-citation-chunker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-skilled_glee-ocr-citation-chunker",
        "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/skilled_glee~ocr-citation-chunker/runs": {
      "post": {
        "operationId": "runs-sync-skilled_glee-ocr-citation-chunker",
        "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/skilled_glee~ocr-citation-chunker/run-sync": {
      "post": {
        "operationId": "run-sync-skilled_glee-ocr-citation-chunker",
        "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": {
          "url": {
            "title": "Single source URL",
            "type": "string",
            "description": "A single public PDF, PNG, or JPG URL. Provide at least one of url, urls, sourceFile, sourceBase64, or datasetId."
          },
          "urls": {
            "title": "Batch source URLs",
            "maxItems": 200,
            "type": "array",
            "description": "Optional batch of up to 200 public PDF, PNG, or JPG URLs.",
            "items": {
              "type": "string"
            }
          },
          "sourceFile": {
            "title": "Upload file",
            "type": "string",
            "description": "Upload a PDF, PNG, or JPG from the Apify file picker (stored in the run key-value store)."
          },
          "sourceBase64": {
            "title": "Base64 file",
            "type": "string",
            "description": "A PDF, PNG, or JPG encoded as base64 (plain or a data: URL). Useful for agents and MCP callers."
          },
          "datasetId": {
            "title": "Apify dataset ID",
            "type": "string",
            "description": "Apify dataset whose items supply sources. Each item may contain url, urls, src, imageUrl, pdfUrl, sourceBase64, pdfBase64, or imageBase64."
          },
          "datasetIds": {
            "title": "Apify dataset IDs",
            "type": "array",
            "description": "Optional batch of Apify dataset IDs with the same item shape as datasetId."
          },
          "languages": {
            "title": "OCR languages",
            "type": "string",
            "description": "Tesseract languages as a + joined string (for example eng or eng+spa) or a JSON array of language codes. Default eng. Installed packs: eng, spa, fra, deu, ita, por, nld, pol, rus, ukr, tur, ara, hin, chi_sim, chi_tra, jpn, kor, vie, ind, swe, ces, ell, heb. Unknown codes fail the run as invalid input and are not charged as page-processed events.",
            "default": "eng"
          },
          "pageRanges": {
            "title": "Page ranges",
            "type": "string",
            "description": "Optional 1-based PDF page selection, for example 1-5,8,10-12. Ignored for single-image sources. Invalid ranges fail as invalid input and are not charged."
          },
          "maxPages": {
            "title": "Max pages per document",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Process at most this many pages per document after pageRanges is applied. Default 100. Extra pages are skipped (not a document failure) and are not charged.",
            "default": 100
          },
          "chunkSize": {
            "title": "Chunk size",
            "minimum": 500,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum characters per chunk. Default 3000 when omitted.",
            "default": 3000
          },
          "overlap": {
            "title": "Chunk overlap",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "How many characters overlap between adjacent chunks. Default 300 when omitted; must be smaller than chunkSize.",
            "default": 300
          },
          "ocrWorkers": {
            "title": "OCR worker threads",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Requested parallel Tesseract workers from 1 to 8. The runtime caps the effective count by available memory at approximately 256 MB per worker.",
            "default": 4
          },
          "ocrDpi": {
            "title": "OCR render DPI",
            "minimum": 100,
            "maximum": 300,
            "type": "integer",
            "description": "Resolution used to rasterize PDF pages or images before OCR. Higher values can improve dense scans but increase runtime and memory use.",
            "default": 200
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}