{
    "openapi": "3.0.0",
    "info": {
        "title": "银行汇率表 - API文档",
        "version": "1.0.0",
        "description": "该接口支持查询国内十大银行外汇牌价汇率，单位为人民币兑100外币。接口支持的<a href=\"https:\/\/www.tianapi.com\/article\/165\" target=\"_blank\">银行简写编码<\/a>。如需查询具体的外币汇率请使用<a href=\"https:\/\/www.tianapi.com\/apiview\/119\" target=\"_blank\">汇率查询API<\/a>。因政策原因数据存在延迟，仅供分析统计参考使用，不得用于终端展示。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/fxratelist\/index": {
            "get": {
                "summary": "银行汇率表查询",
                "tags": [
                    "银行汇率表"
                ],
                "description": "查询各大银行汇率价格数据",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "bank",
                        "in": "query",
                        "description": "银行英文简写，如工商银行icbc",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "icbc",
                            "description": "银行英文简写，如工商银行icbc"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "bank": {
                                            "type": "string",
                                            "example": "ICBC",
                                            "description": "银行英文缩写"
                                        },
                                        "cash_buy": {
                                            "type": "string",
                                            "example": "6.3565",
                                            "description": "现钞买入价"
                                        },
                                        "spot_buy": {
                                            "type": "string",
                                            "example": "6.5436",
                                            "description": "现汇买入价"
                                        },
                                        "bank_rate": {
                                            "type": "string",
                                            "example": " - ",
                                            "description": "银行折算价"
                                        },
                                        "cash_sell": {
                                            "type": "string",
                                            "example": "6.5922",
                                            "description": "现钞卖出价"
                                        },
                                        "coin_code": {
                                            "type": "string",
                                            "example": "JPY",
                                            "description": "货币简写"
                                        },
                                        "coin_name": {
                                            "type": "string",
                                            "example": "日元",
                                            "description": "货币名称"
                                        },
                                        "mid_price": {
                                            "type": "string",
                                            "example": " - ",
                                            "description": "中间价"
                                        },
                                        "spot_sell": {
                                            "type": "string",
                                            "example": "6.5922",
                                            "description": "现汇卖出价"
                                        },
                                        "update_time": {
                                            "type": "string",
                                            "example": "2019-09-20 16:28:00",
                                            "description": "汇率表更新时间"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "bank": "ICBC",
                                        "list": [
                                            {
                                                "cash_buy": "706.6800",
                                                "spot_buy": "727.4800",
                                                "cash_sell": "732.6000",
                                                "coin_code": "CHF",
                                                "coin_name": "瑞士法郎",
                                                "mid_price": "--",
                                                "spot_sell": "732.6000"
                                            },
                                            {
                                                "cash_buy": "91.1200",
                                                "spot_buy": "91.8700",
                                                "cash_sell": "92.2100",
                                                "coin_code": "HKD",
                                                "coin_name": "港币",
                                                "mid_price": "--",
                                                "spot_sell": "92.2100"
                                            },
                                            {
                                                "cash_buy": "21.5500",
                                                "spot_buy": "21.5500",
                                                "cash_sell": "23.2000",
                                                "coin_code": "TWD",
                                                "coin_name": "新台币",
                                                "mid_price": "--",
                                                "spot_sell": "23.2000"
                                            }
                                        ],
                                        "update_time": "2022-11-07 19:41:00"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "银行汇率表查询",
                "tags": [
                    "银行汇率表"
                ],
                "description": "查询各大银行汇率价格数据",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "bank": {
                                        "type": "string",
                                        "example": "icbc",
                                        "description": "银行英文简写，如工商银行icbc"
                                    }
                                },
                                "required": [
                                    "key",
                                    "bank"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "bank": {
                                            "type": "string",
                                            "example": "ICBC",
                                            "description": "银行英文缩写"
                                        },
                                        "cash_buy": {
                                            "type": "string",
                                            "example": "6.3565",
                                            "description": "现钞买入价"
                                        },
                                        "spot_buy": {
                                            "type": "string",
                                            "example": "6.5436",
                                            "description": "现汇买入价"
                                        },
                                        "bank_rate": {
                                            "type": "string",
                                            "example": " - ",
                                            "description": "银行折算价"
                                        },
                                        "cash_sell": {
                                            "type": "string",
                                            "example": "6.5922",
                                            "description": "现钞卖出价"
                                        },
                                        "coin_code": {
                                            "type": "string",
                                            "example": "JPY",
                                            "description": "货币简写"
                                        },
                                        "coin_name": {
                                            "type": "string",
                                            "example": "日元",
                                            "description": "货币名称"
                                        },
                                        "mid_price": {
                                            "type": "string",
                                            "example": " - ",
                                            "description": "中间价"
                                        },
                                        "spot_sell": {
                                            "type": "string",
                                            "example": "6.5922",
                                            "description": "现汇卖出价"
                                        },
                                        "update_time": {
                                            "type": "string",
                                            "example": "2019-09-20 16:28:00",
                                            "description": "汇率表更新时间"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "bank": "ICBC",
                                        "list": [
                                            {
                                                "cash_buy": "706.6800",
                                                "spot_buy": "727.4800",
                                                "cash_sell": "732.6000",
                                                "coin_code": "CHF",
                                                "coin_name": "瑞士法郎",
                                                "mid_price": "--",
                                                "spot_sell": "732.6000"
                                            },
                                            {
                                                "cash_buy": "91.1200",
                                                "spot_buy": "91.8700",
                                                "cash_sell": "92.2100",
                                                "coin_code": "HKD",
                                                "coin_name": "港币",
                                                "mid_price": "--",
                                                "spot_sell": "92.2100"
                                            },
                                            {
                                                "cash_buy": "21.5500",
                                                "spot_buy": "21.5500",
                                                "cash_sell": "23.2000",
                                                "coin_code": "TWD",
                                                "coin_name": "新台币",
                                                "mid_price": "--",
                                                "spot_sell": "23.2000"
                                            }
                                        ],
                                        "update_time": "2022-11-07 19:41:00"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}