{
  "openapi": "3.0.3",
  "info": {
    "title": "银行汇率查询",
    "description": "提供主流银行外汇牌价汇率查询，支持外汇币种列表、历史汇率查询及币种间汇率转换。数据为延迟数据，仅供参考，实际交易汇率以当地银行为准。",
    "termsOfService": "https://www.showapi.com/helpcenter/view#/4019/2",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://route.showapi.com"
    }
  ],
  "paths": {
    "/105-35": {
      "x-pointCode": 35,
      "x-mode": "mapping",
      "x-read-timeout": 30,
      "x-connect-timeout": 30,
      "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": "number"
                            },
                            "exchange_list": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "flag": {
                                    "type": "string",
                                    "description": "旗帜"
                                  },
                                  "name": {
                                    "type": "string",
                                    "description": "货币名称"
                                  },
                                  "code": {
                                    "type": "string",
                                    "description": "货币代码"
                                  }
                                }
                              }
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "105_35_POST",
        "parameters": []
      }
    },
    "/105-34": {
      "x-pointCode": 34,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 15,
      "post": {
        "summary": "查询历史汇率",
        "description": "历史外币汇率（100外币兑人民币）可查询自2009年1月起的记录，涵盖英镑、美元、欧元等20多种常见货币。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "startDate": {
                              "type": "string",
                              "description": "开始日期"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "接口调用是否成功,0为成功,其他为失败"
                            },
                            "currency_name": {
                              "type": "string",
                              "description": "货币名称"
                            },
                            "remark": {
                              "type": "string",
                              "description": "提示信息"
                            },
                            "month": {
                              "type": "string",
                              "description": "查询年月"
                            },
                            "list": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "middle_rate": {
                                    "type": "string",
                                    "description": "中行折算价"
                                  },
                                  "publish_time": {
                                    "type": "string",
                                    "description": "发布日期"
                                  },
                                  "cash_selling_rate": {
                                    "type": "string",
                                    "description": "现钞卖出价"
                                  },
                                  "buying_rate": {
                                    "type": "string",
                                    "description": "现汇买入价"
                                  },
                                  "cash_buying_rate": {
                                    "type": "string",
                                    "description": "现钞买入价"
                                  },
                                  "selling_rate": {
                                    "type": "string",
                                    "description": "现汇卖出价"
                                  }
                                }
                              },
                              "description": "返回列表"
                            },
                            "endDate": {
                              "type": "string",
                              "description": "结束日期"
                            },
                            "currency_code": {
                              "type": "string",
                              "description": "货币编号"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "105_34_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "货币编号"
                  },
                  "name": {
                    "type": "string",
                    "description": "货币名称"
                  },
                  "month": {
                    "type": "string",
                    "description": "查询年月（yyyyMM）与startDate和endDate互斥"
                  },
                  "startDate": {
                    "type": "string",
                    "description": "查询起始时间yyyyMMdd，最大可查询区间为90天"
                  },
                  "endDate": {
                    "type": "string",
                    "description": "查询结束时间yyyyMMdd，最大可查询区间为90天"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/105-31": {
      "x-pointCode": 31,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 15,
      "post": {
        "summary": "汇率转换",
        "description": "汇率转换API可依据实时汇率，将指定金额的人民币兑换为美元或其他外币，例如人民币100元对应的美元或外币金额。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "money": {
                              "type": "string",
                              "description": "转换后的金额，单位元"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "0为成功，其他失败"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "105_31_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "fromCode": {
                    "type": "string",
                    "description": "源货币类型"
                  },
                  "toCode": {
                    "type": "string",
                    "description": "目标货币类型"
                  },
                  "money": {
                    "type": "string",
                    "description": "转换的金额，单位元"
                  }
                },
                "required": [
                  "fromCode",
                  "toCode",
                  "money"
                ]
              }
            }
          }
        }
      }
    },
    "/105-30": {
      "x-pointCode": 30,
      "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": {
                            "listSize": {
                              "type": "number",
                              "description": "返回的数据列表长度"
                            },
                            "list": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string",
                                    "description": "货币名称"
                                  },
                                  "code": {
                                    "type": "string",
                                    "description": "货币简码"
                                  },
                                  "hui_in": {
                                    "type": "string",
                                    "description": "现汇买入价"
                                  },
                                  "chao_in": {
                                    "type": "string",
                                    "description": "现钞买入价"
                                  },
                                  "hui_out": {
                                    "type": "string",
                                    "description": "现汇卖出价"
                                  },
                                  "chao_out": {
                                    "type": "string",
                                    "description": "现钞卖出价"
                                  },
                                  "zhesuan": {
                                    "type": "string",
                                    "description": "中行折算价"
                                  },
                                  "day": {
                                    "type": "string",
                                    "description": "发布天"
                                  },
                                  "time": {
                                    "type": "string",
                                    "description": "发布时间"
                                  }
                                }
                              },
                              "description": "数据列表"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "0为成功，其他失败"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "105_30_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "需要查询的货币缩写。比如人民币是CNY，美元是USD，如果不输入，则返回全部。"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "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/apis/105?tab=book"
  },
  "x-apiCode": "105",
  "x-is-own": false,
  "x-is-op": false
}