{
    "openapi": "3.0.0",
    "info": {
        "title": "汇率查询 - API文档",
        "version": "1.0.0",
        "description": "中国银行外汇牌价汇率查询，例如可以查询人民币兑美元、欧元等常见国家货币的实时外汇牌价汇率等。因政策原因数据延迟发布，仅供内部数据统计分析参考使用，不得用于终端展示。<a href=\"https:\/\/www.tianapi.com\/apiview\/120\" target=\"_blank\">十大银行汇率表<\/a>、<a href=\"https:\/\/www.tianapi.com\/article\/109\" target=\"_blank\">汇率查询API接口支持的所有币种列表<\/a>"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/fxrate\/index": {
            "get": {
                "summary": "查询汇率详情",
                "tags": [
                    "汇率查询"
                ],
                "description": "查询货币汇率详情动态数据",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "money",
                        "in": "query",
                        "description": "兑换金额，单位元",
                        "required": true,
                        "schema": {
                            "type": "int",
                            "example": 1,
                            "description": "兑换金额，单位元"
                        }
                    },
                    {
                        "name": "tocoin",
                        "in": "query",
                        "description": "目标兑换货币，例如人民币CNY",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "CNY",
                            "description": "目标兑换货币，例如人民币CNY"
                        }
                    },
                    {
                        "name": "fromcoin",
                        "in": "query",
                        "description": "来源货币，例如美元USD",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "USD",
                            "description": "来源货币，例如美元USD"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "money": {
                                            "type": "string",
                                            "example": "7.0752",
                                            "description": "金额价格，单位元"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "money": "7.0752"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "查询汇率详情",
                "tags": [
                    "汇率查询"
                ],
                "description": "查询货币汇率详情动态数据",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "money": {
                                        "type": "int",
                                        "example": 1,
                                        "description": "兑换金额，单位元"
                                    },
                                    "tocoin": {
                                        "type": "string",
                                        "example": "CNY",
                                        "description": "目标兑换货币，例如人民币CNY"
                                    },
                                    "fromcoin": {
                                        "type": "string",
                                        "example": "USD",
                                        "description": "来源货币，例如美元USD"
                                    }
                                },
                                "required": [
                                    "key",
                                    "money",
                                    "tocoin",
                                    "fromcoin"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "money": {
                                            "type": "string",
                                            "example": "7.0752",
                                            "description": "金额价格，单位元"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "money": "7.0752"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}