{
  "openapi": "3.0.1",
  "info": {
    "title": "Document to Markdown Converter — AI-Ready Format",
    "description": "Convert 19+ document formats to clean Markdown for AI/LLM training, RAG pipelines, and content migration. Supports PDF, Word, PowerPoint, Excel, Wikipedia, YouTube, images, audio, CSV, Jupyter notebooks, and more. Bypass IP blocks with residential proxies. AI-powered image descriptions via GPT-4o.",
    "version": "1.0",
    "x-build-id": "T216objX3PUIlVg3k"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/openclawai~document-to-markdown-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-openclawai-document-to-markdown-converter",
        "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/openclawai~document-to-markdown-converter/runs": {
      "post": {
        "operationId": "runs-sync-openclawai-document-to-markdown-converter",
        "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/openclawai~document-to-markdown-converter/run-sync": {
      "post": {
        "operationId": "run-sync-openclawai-document-to-markdown-converter",
        "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": [
          "documentUrls"
        ],
        "properties": {
          "action": {
            "title": "Action",
            "enum": [
              "convert_document",
              "batch_convert",
              "convert_with_llm"
            ],
            "type": "string",
            "description": "**What operation to perform**\n\n• **Convert Single Document** - Convert one document to Markdown\n• **Batch Convert** - Convert multiple documents\n• **Convert with LLM** - Use AI to describe images in documents (requires OpenAI API key)",
            "default": "convert_document"
          },
          "documentUrls": {
            "title": "Document URL(s)",
            "type": "array",
            "description": "**URLs of documents to convert (19 formats supported)**\n\n📄 **Office Docs**: PDF, DOCX, PPTX, XLSX, XLS (Excel 97-2003)\n🖼️ **Images**: PNG, JPG, GIF, BMP (with EXIF + OCR)\n🎵 **Audio**: MP3, WAV (speech transcription)\n🌐 **Web**: HTML, YouTube URLs, RSS feeds, Wikipedia pages, Bing search\n📊 **Data**: CSV, JSON, XML, Jupyter notebooks (.ipynb)\n📧 **Email**: Outlook messages (.msg)\n📦 **Archives**: ZIP, EPub\n📝 **Text**: TXT, Markdown\n\nExamples:\n• `https://example.com/document.pdf`\n• `https://example.com/presentation.pptx`\n• `https://www.youtube.com/watch?v=VIDEO_ID`\n• `https://en.wikipedia.org/wiki/Python_(programming_language)`\n• `https://example.com/notebook.ipynb`",
            "items": {
              "type": "string"
            }
          },
          "outputFormats": {
            "title": "Output Formats",
            "uniqueItems": true,
            "type": "array",
            "description": "**Which formats to generate**\n\n• **Markdown** - Clean .md format (recommended for LLMs)\n• **JSON** - Structured data with metadata\n• **Text** - Plain text only",
            "items": {
              "type": "string",
              "enum": [
                "markdown",
                "json",
                "text"
              ]
            },
            "default": [
              "markdown",
              "json"
            ]
          },
          "enableLLMImageDescription": {
            "title": "Enable AI Image Descriptions",
            "type": "boolean",
            "description": "**Use OpenAI GPT-4o to describe images in documents**\n\n✅ Enabled: Images become text descriptions (great for PDFs/PPTXwith charts/diagrams)\n❌ Disabled: Images show as `[Image]` placeholders\n\n⚠️ Requires OpenAI API key (set in `openaiApiKey` field)\n💰 Costs: ~$0.01 per image",
            "default": false
          },
          "openaiApiKey": {
            "title": "OpenAI API Key",
            "type": "string",
            "description": "**Your OpenAI API key for image descriptions**\n\nGet one at: https://platform.openai.com/api-keys\n\n🔒 Stored securely, never logged"
          },
          "llmModel": {
            "title": "LLM Model",
            "enum": [
              "gpt-4o",
              "gpt-4o-mini",
              "gpt-4-turbo"
            ],
            "type": "string",
            "description": "**Which OpenAI model to use for image descriptions**",
            "default": "gpt-4o"
          },
          "customLLMPrompt": {
            "title": "Custom LLM Prompt",
            "type": "string",
            "description": "**Optional custom prompt for image descriptions**\n\nDefault: \"Describe this image in detail\"\n\nExample custom prompt:\n`Extract all text and describe the chart. Focus on numbers and trends.`"
          },
          "enableOCR": {
            "title": "Enable OCR (Images)",
            "type": "boolean",
            "description": "**Extract text from images using OCR**\n\nUseful for:\n• Scanned documents\n• Screenshots\n• Image-based PDFs\n\n⚠️ Requires `enableLLMImageDescription` to be enabled",
            "default": false
          },
          "enableAzureDocIntel": {
            "title": "Use Azure Document Intelligence",
            "type": "boolean",
            "description": "**Use Microsoft Azure Document Intelligence for PDF conversion**\n\nPros:\n• More accurate table extraction\n• Better layout detection\n• Enterprise-grade OCR\n\nCons:\n• Requires Azure credentials\n• Slower than local conversion\n\n⚠️ Requires Azure endpoint and key",
            "default": false
          },
          "azureDocIntelEndpoint": {
            "title": "Azure Document Intelligence Endpoint",
            "type": "string",
            "description": "**Your Azure Document Intelligence endpoint**\n\nExample: `https://YOUR-RESOURCE.cognitiveservices.azure.com/`"
          },
          "azureDocIntelKey": {
            "title": "Azure Document Intelligence Key",
            "type": "string",
            "description": "**Your Azure Document Intelligence API key**"
          },
          "maxDocuments": {
            "title": "Max Documents",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "**Maximum number of documents to process**\n\n🟢 Quick test: 1-5\n🟡 Normal: 5-50\n🔴 Large batch: 50-500",
            "default": 10
          },
          "timeout": {
            "title": "Timeout (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "**Maximum time to process each document**\n\nDefault: 300 seconds (5 minutes)\n\nIncrease for large files or slow networks",
            "default": 300
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "**Proxy settings for downloading documents**\n\n✅ **RESIDENTIAL proxies recommended** to bypass IP blocks (Wikipedia, universities, etc.)\n\nBenefits:\n• Bypass IP blocking (Wikipedia, Harvard, etc.)\n• Avoid geo-restrictions\n• Better reliability",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}