# Document Base URL `https://api.sniphunter.com` 文档上传、解析和文本提取。 # Document ## GET /api/v1/document/formats Document Formats ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## POST /api/v1/document/parse Document Parse 通过文件 URL 解析文档(Word / Excel / PDF / PPT / TXT 等)。 ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocumentParseRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/document/parse/upload Document Parse Upload 上传文档并解析。 ```json { "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_document_parse_upload_api_v1_document_parse_upload_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Components ```json { "schemas": { "Body_document_parse_upload_api_v1_document_parse_upload_post": { "properties": { "file": { "type": "string", "format": "binary", "title": "File" }, "output": { "type": "string", "title": "Output", "default": "text" } }, "type": "object", "required": [ "file" ], "title": "Body_document_parse_upload_api_v1_document_parse_upload_post" }, "DocumentParseRequest": { "properties": { "file_url": { "type": "string", "minLength": 1, "title": "File Url" }, "output": { "type": "string", "enum": [ "text", "markdown" ], "title": "Output", "default": "text" } }, "type": "object", "required": [ "file_url" ], "title": "DocumentParseRequest" }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" } }, "securitySchemes": { "HTTPBearer": { "type": "http", "scheme": "bearer" } } } ```