{
  "openapi": "3.0.3",
  "info": {
    "title": "HTML转Markdown",
    "description": "智能HTML转Markdown接口是一款功能强大的格式转换工具，致力于将HTML内容转换为Markdown格式，支持代码、表格等多种复杂格式转换。以满足内容迁移、数据处理与分析、机器学习等多种应用场景的需求。操作简单实用，可以大幅提高工作效率，为用户提供便捷、高效的解决方案。",
    "termsOfService": "https://www.showapi.com/helpcenter/view#/4019/2",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://route.showapi.com"
    }
  ],
  "paths": {
    "/3193-4": {
      "x-pointCode": 4,
      "x-mode": "mapping",
      "x-read-timeout": 60,
      "x-connect-timeout": 60,
      "post": {
        "summary": "转换历史",
        "description": "HTML转MarkdownAPI接口的转化历史接入点可查询最近的转换历史。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "allNum": {
                              "type": "number",
                              "description": "列表总数"
                            },
                            "contentlist": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "task_id": {
                                    "type": "string",
                                    "description": "历史任务id"
                                  },
                                  "ct": {
                                    "type": "string",
                                    "description": "任务时间"
                                  },
                                  "task_status": {
                                    "type": "string",
                                    "description": "任务状态（not_exit, waiting, success. fail）"
                                  },
                                  "task_name": {
                                    "type": "string",
                                    "description": "任务名称"
                                  }
                                }
                              },
                              "description": "返回列表"
                            },
                            "remark": {
                              "type": "string",
                              "description": "请求描述信息"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "0成功，其它失败"
                            },
                            "currentPage": {
                              "type": "number",
                              "description": "当前页码"
                            },
                            "allPages": {
                              "type": "number",
                              "description": "总页数"
                            },
                            "maxResult": {
                              "type": "number",
                              "description": "当前页最大数"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "3193_4_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "page": {
                    "type": "string",
                    "description": "查询页面"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/3193-3": {
      "x-pointCode": 3,
      "x-mode": "mapping",
      "x-read-timeout": 60,
      "x-connect-timeout": 60,
      "post": {
        "summary": "转换详情",
        "description": "HTML转MarkdownAPI接口允许用户根据任务ID(task_id)查询HTML到Markdown格式转换任务的当前状态，方便用户跟踪转换进度和结果。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "remark": {
                      "type": "string",
                      "description": "请求描述信息"
                    },
                    "md_text": {
                      "type": "string",
                      "description": "markdown格式的文本（文档生成成功后返回）"
                    },
                    "ret_code": {
                      "type": "number",
                      "description": "0成功，其它失败"
                    },
                    "task_status": {
                      "type": "string",
                      "description": "文档生成状态 （此状态在返回头中也包含，返回格式为Markdown的可从返回头中获取）\n1、not_exit 任务不存在\n2、waiting 任务执行中\n3、success 任务执行成功\n4、fail 任务执行失败"
                    },
                    "task_name": {
                      "type": "string",
                      "description": "任务名称"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "3193_3_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "task_id": {
                    "type": "string",
                    "description": "提交异步任务时返回的任务id"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/3193-2": {
      "x-pointCode": 2,
      "x-mode": "mapping",
      "x-read-timeout": 120,
      "x-connect-timeout": 60,
      "post": {
        "summary": "HTML转换MD",
        "description": "该接口功能是将网页HTML源码转换成Markdown格式的文本。本接口以每消耗3000个token（对应HTML中正文文字数量约为2300个）计费一次。如果HTML正文文字过多，则存在多次计费的情况。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "remark": {
                      "type": "string",
                      "description": "请求描述信息"
                    },
                    "md_text": {
                      "type": "string",
                      "description": "markdown格式的文本（同步时返回内容）"
                    },
                    "ret_code": {
                      "type": "number",
                      "description": "0成功，其它失败"
                    },
                    "task_id": {
                      "type": "string",
                      "description": "异步任务id（异步时返回，用于查询异步历史及详情）"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "3193_2_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "html": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 1000000,
                    "description": "网页的HTML源码"
                  },
                  "ret_type": {
                    "type": "string",
                    "description": "返回格式\njson （默认值）\nmarkdown"
                  },
                  "run_type": {
                    "type": "string",
                    "description": "执行方式\nsync： 同步返回（生成时间比较长，容易超时，建议使用异步）\nasync：异步返回（默认值）"
                  },
                  "task_name": {
                    "type": "string",
                    "description": "任务名称"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AppKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "appKey",
        "description": "从 ShowAPI 控制台获取的 appKey，管理地址：https://www.showapi.com/console#/myApp"
      }
    },
    "schemas": {
      "ShowapiResEnvelope": {
        "type": "object",
        "description": "ShowAPI 统一返回包裹（业务数据位于 showapi_res_body）",
        "properties": {
          "showapi_res_code": {
            "type": "integer",
            "description": "API 返回的状态码"
          },
          "showapi_res_error": {
            "type": "string",
            "description": "API 返回的错误信息"
          },
          "showapi_res_id": {
            "type": "string",
            "description": "API 请求的唯一标识"
          },
          "showapi_fee_num": {
            "type": "integer",
            "description": "API 调用计费次数"
          }
        }
      }
    }
  },
  "security": [
    {
      "AppKeyAuth": []
    }
  ],
  "externalDocs": {
    "url": "https://www.showapi.com/apiGateway/view/3193?tab=book"
  },
  "x-apiCode": "3193",
  "x-is-own": true,
  "x-is-op": true
}