{
    "openapi": "3.0.0",
    "info": {
        "title": "黄金行情 - API文档",
        "version": "1.0.0",
        "description": "<p>上金所黄金白银行情查询，支持批量查询，多个种类用半角逗号分隔，如au9999,agTplusD。接口支持查询的种类代码表<a href=\"https:\/\/www.tianapi.com\/article\/166\" target=\"_blank\">点此查看<\/a>。<\/p>"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/gold\/index": {
            "get": {
                "summary": "黄金行情查询",
                "tags": [
                    "黄金行情"
                ],
                "description": "根据贵金属种类查询行情动态数据",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "kinds",
                        "in": "query",
                        "description": "黄金种类代码，多个用半角逗号,分隔",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "au9999,agTplusD",
                            "description": "黄金种类代码，多个用半角逗号,分隔"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "raf": {
                                            "type": "float",
                                            "example": -0.74512094,
                                            "description": "涨跌幅%"
                                        },
                                        "code": {
                                            "type": "string",
                                            "example": "au9999",
                                            "description": "黄金种类代码"
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "off",
                                            "description": "市场状态"
                                        },
                                        "buyprice": {
                                            "type": "float",
                                            "example": 329.02,
                                            "description": "买入价"
                                        },
                                        "lowprice": {
                                            "type": "float",
                                            "example": 327.02,
                                            "description": "最低价"
                                        },
                                        "rafvalue": {
                                            "type": "float",
                                            "example": -2.4700012,
                                            "description": "涨跌"
                                        },
                                        "highprice": {
                                            "type": "float",
                                            "example": 335,
                                            "description": "最高价"
                                        },
                                        "openprice": {
                                            "type": "float",
                                            "example": 335,
                                            "description": "开盘价"
                                        },
                                        "sellprice": {
                                            "type": "float",
                                            "example": 330,
                                            "description": "卖出价"
                                        },
                                        "closeprice": {
                                            "type": "float",
                                            "example": 331.49,
                                            "description": "收盘价"
                                        },
                                        "updatetime": {
                                            "type": "string",
                                            "example": "2019-11-09 02:28:55",
                                            "description": "更新时间"
                                        },
                                        "latestprice": {
                                            "type": "float",
                                            "example": 329.02,
                                            "description": "最新价"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "raf": -0.74512094,
                                                "code": "au9999",
                                                "status": "off",
                                                "buyprice": 329.02,
                                                "lowprice": 327.02,
                                                "rafvalue": -2.4700012,
                                                "highprice": 335,
                                                "openprice": 335,
                                                "sellprice": 330,
                                                "closeprice": 331.49,
                                                "updatetime": "2019-11-09 02:28:55",
                                                "latestprice": 329.02
                                            },
                                            {
                                                "raf": -0.91832054,
                                                "code": "au9995",
                                                "status": "off",
                                                "buyprice": 318.99,
                                                "lowprice": 328,
                                                "rafvalue": -3.0400085,
                                                "highprice": 328.1,
                                                "openprice": 328.1,
                                                "sellprice": 0,
                                                "closeprice": 331.04,
                                                "updatetime": "2019-11-08 23:30:51",
                                                "latestprice": 328
                                            },
                                            {
                                                "raf": -2.0531402,
                                                "code": "agTplusD",
                                                "status": "off",
                                                "buyprice": 4055,
                                                "lowprice": 4015,
                                                "rafvalue": -85,
                                                "highprice": 4089,
                                                "openprice": 4054,
                                                "sellprice": 4065,
                                                "closeprice": 4140,
                                                "updatetime": "2019-11-09 02:29:59",
                                                "latestprice": 4055
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "黄金行情查询",
                "tags": [
                    "黄金行情"
                ],
                "description": "根据贵金属种类查询行情动态数据",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "kinds": {
                                        "type": "string",
                                        "example": "au9999,agTplusD",
                                        "description": "黄金种类代码，多个用半角逗号,分隔"
                                    }
                                },
                                "required": [
                                    "key",
                                    "kinds"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "raf": {
                                            "type": "float",
                                            "example": -0.74512094,
                                            "description": "涨跌幅%"
                                        },
                                        "code": {
                                            "type": "string",
                                            "example": "au9999",
                                            "description": "黄金种类代码"
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "off",
                                            "description": "市场状态"
                                        },
                                        "buyprice": {
                                            "type": "float",
                                            "example": 329.02,
                                            "description": "买入价"
                                        },
                                        "lowprice": {
                                            "type": "float",
                                            "example": 327.02,
                                            "description": "最低价"
                                        },
                                        "rafvalue": {
                                            "type": "float",
                                            "example": -2.4700012,
                                            "description": "涨跌"
                                        },
                                        "highprice": {
                                            "type": "float",
                                            "example": 335,
                                            "description": "最高价"
                                        },
                                        "openprice": {
                                            "type": "float",
                                            "example": 335,
                                            "description": "开盘价"
                                        },
                                        "sellprice": {
                                            "type": "float",
                                            "example": 330,
                                            "description": "卖出价"
                                        },
                                        "closeprice": {
                                            "type": "float",
                                            "example": 331.49,
                                            "description": "收盘价"
                                        },
                                        "updatetime": {
                                            "type": "string",
                                            "example": "2019-11-09 02:28:55",
                                            "description": "更新时间"
                                        },
                                        "latestprice": {
                                            "type": "float",
                                            "example": 329.02,
                                            "description": "最新价"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "raf": -0.74512094,
                                                "code": "au9999",
                                                "status": "off",
                                                "buyprice": 329.02,
                                                "lowprice": 327.02,
                                                "rafvalue": -2.4700012,
                                                "highprice": 335,
                                                "openprice": 335,
                                                "sellprice": 330,
                                                "closeprice": 331.49,
                                                "updatetime": "2019-11-09 02:28:55",
                                                "latestprice": 329.02
                                            },
                                            {
                                                "raf": -0.91832054,
                                                "code": "au9995",
                                                "status": "off",
                                                "buyprice": 318.99,
                                                "lowprice": 328,
                                                "rafvalue": -3.0400085,
                                                "highprice": 328.1,
                                                "openprice": 328.1,
                                                "sellprice": 0,
                                                "closeprice": 331.04,
                                                "updatetime": "2019-11-08 23:30:51",
                                                "latestprice": 328
                                            },
                                            {
                                                "raf": -2.0531402,
                                                "code": "agTplusD",
                                                "status": "off",
                                                "buyprice": 4055,
                                                "lowprice": 4015,
                                                "rafvalue": -85,
                                                "highprice": 4089,
                                                "openprice": 4054,
                                                "sellprice": 4065,
                                                "closeprice": 4140,
                                                "updatetime": "2019-11-09 02:29:59",
                                                "latestprice": 4055
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}