{
  "openapi": "3.0.3",
  "info": {
    "title": "单位换算器",
    "description": "提供单位转换功能，通过API调用进行不同单位之间的转换，包括长度、重量、体积、温度、速度、时间、压力等各种常见的物理量单位。应用于科学研究、工程计算、物流运输等，为开发者提供方便、快捷和准确的单位转换功能。实现在线长度、面积、重量、体积、容量、温度计量、功率的压力等计量单位转换。",
    "termsOfService": "https://www.showapi.com/helpcenter/view#/4019/2",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://route.showapi.com"
    }
  ],
  "paths": {
    "/1690-16": {
      "x-pointCode": 16,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 15,
      "post": {
        "summary": "支持的类型",
        "description": "单位换算支持接口返回支持的类型，适用于日常生活、科学研究、工业生产等场景，帮助用户准确地进行各种单位之间的转换。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "ret_code": {
                              "type": "string",
                              "description": "接口调用是否成功,0:扣费，表示成功,-1:不扣费，表示查询失败"
                            },
                            "result": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "unit": {
                                    "type": "string",
                                    "description": "单位名称"
                                  },
                                  "type": {
                                    "type": "string",
                                    "description": "所属分类"
                                  },
                                  "code": {
                                    "type": "string",
                                    "description": "请填写参数描述"
                                  }
                                }
                              },
                              "description": "返回结果"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1690_16_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "angle=角度\n<br>dataStorage=数据存储\n<br>speed=速度\n<br>time=时间\n<br>energy=力\n<br>density=密度\n<br>work=功、能、热\n<br>power=功率\n<br>pressure=压力\n<br>temperature=温度\n<br>weight=质量\n<br>volume=体积\n<br>area=面积\n<br>longness=长度"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/1690-1": {
      "x-pointCode": 1,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 15,
      "post": {
        "summary": "单位换算",
        "description": "在线公里(km)、米(m)、分米(dm)、厘米(cm)、里、丈、尺、寸、分、厘、海里(nmi)、英寻、英里、弗隆(fur)、码(yd)、英尺(ft)、英寸(in)、毫米(mm)、微米(um)等单位转换",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "ret_code": {
                              "type": "string",
                              "description": "接口调用是否成功,0:扣费，表示成功,-1:不扣费，表示查询失败"
                            },
                            "result_list": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "result_str": {
                                    "type": "string",
                                    "description": "字符型结果"
                                  },
                                  "unit": {
                                    "type": "string",
                                    "description": "单位"
                                  },
                                  "result": {
                                    "type": "string",
                                    "description": "结果"
                                  },
                                  "type": {
                                    "type": "string",
                                    "description": "请填写参数描述"
                                  }
                                }
                              },
                              "description": "返回结果"
                            },
                            "remark": {
                              "type": "string",
                              "description": "返回说明"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1690_1_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "num": {
                    "type": "string",
                    "description": "需要转换的数字"
                  },
                  "from": {
                    "type": "string",
                    "description": "源单位"
                  },
                  "to": {
                    "type": "string",
                    "description": "目标单位"
                  },
                  "type": {
                    "type": "string",
                    "description": "angle=角度\n<br>dataStorage=数据存储\n<br>speed=速度\n<br>time=时间\n<br>energy=力\n<br>density=密度\n<br>work=功、能、热\n<br>power=功率\n<br>pressure=压力\n<br>temperature=温度\n<br>weight=质量\n<br>volume=体积\n<br>area=面积\n<br>longness=长度"
                  }
                },
                "required": [
                  "num",
                  "from",
                  "to"
                ]
              }
            }
          }
        }
      }
    }
  },
  "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/1690?tab=book"
  },
  "x-apiCode": "1690",
  "x-is-own": true,
  "x-is-op": true
}