SnipHunter API

Document

文档上传、解析和文本提取。

Base URL https://api.sniphunter.com

OpenAPI JSON · 完整 Markdown

请求与响应中的 $ref 在 OpenAPI 的 components 中定义。

3 个接口

Document

GET/api/v1/document/formatsDocument Formats

{
  "responses": {
    "200": {
      "description": "Successful Response",
      "content": {
        "application/json": {
          "schema": {}
        }
      }
    }
  }
}
POST/api/v1/document/parseDocument Parse

通过文件 URL 解析文档(Word / Excel / PDF / PPT / TXT 等)。

{
  "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/uploadDocument Parse Upload

上传文档并解析。

{
  "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
{
  "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"
    }
  }
}