{
    "openapi": "3.0.0",
    "info": {
        "title": "账号信息查询 - API文档",
        "version": "1.0.0",
        "description": "该接口用于查询天行数据账号的天豆额度、接口剩余免费次数和账号等级等数据，方便在第三方场景下判断账号信息。天行数据接口ID如何获得？一、接口文档logo左下的数字ID；二、接口文档url末尾的数字；三、控制台-数据管理-接口详情也可查看接口ID。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/userinfo\/index": {
            "get": {
                "summary": "查询账号余额信息",
                "tags": [
                    "账号信息查询"
                ],
                "description": "查询天聚数行平台的会员及余额等信息",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "apiid",
                        "in": "query",
                        "description": "接口ID",
                        "required": true,
                        "schema": {
                            "type": "int",
                            "example": 1,
                            "description": "接口ID"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "txcoin": {
                                            "type": "int",
                                            "example": 926386,
                                            "description": "账号剩余的天豆"
                                        },
                                        "api_give": {
                                            "type": "int",
                                            "example": 9988,
                                            "description": "接口剩余的免费次数"
                                        },
                                        "api_type": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "接口类型，0免费接口、1计次接口"
                                        },
                                        "api_getnum": {
                                            "type": "int",
                                            "example": 14,
                                            "description": "接口总请求次数"
                                        },
                                        "user_level": {
                                            "type": "int",
                                            "example": 1,
                                            "description": "账号状态，0账号无效、1免费会员、2高级会员、3黄金会员"
                                        },
                                        "update_time": {
                                            "type": "int",
                                            "example": 1577029115,
                                            "description": "数据更新时间戳"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "txcoin": 926386,
                                        "api_give": 9988,
                                        "api_type": 0,
                                        "api_getnum": 14,
                                        "user_level": 1,
                                        "update_time": 1577029115
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "查询账号余额信息",
                "tags": [
                    "账号信息查询"
                ],
                "description": "查询天聚数行平台的会员及余额等信息",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "apiid": {
                                        "type": "int",
                                        "example": 1,
                                        "description": "接口ID"
                                    }
                                },
                                "required": [
                                    "key",
                                    "apiid"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "txcoin": {
                                            "type": "int",
                                            "example": 926386,
                                            "description": "账号剩余的天豆"
                                        },
                                        "api_give": {
                                            "type": "int",
                                            "example": 9988,
                                            "description": "接口剩余的免费次数"
                                        },
                                        "api_type": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "接口类型，0免费接口、1计次接口"
                                        },
                                        "api_getnum": {
                                            "type": "int",
                                            "example": 14,
                                            "description": "接口总请求次数"
                                        },
                                        "user_level": {
                                            "type": "int",
                                            "example": 1,
                                            "description": "账号状态，0账号无效、1免费会员、2高级会员、3黄金会员"
                                        },
                                        "update_time": {
                                            "type": "int",
                                            "example": 1577029115,
                                            "description": "数据更新时间戳"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "txcoin": 926386,
                                        "api_give": 9988,
                                        "api_type": 0,
                                        "api_getnum": 14,
                                        "user_level": 1,
                                        "update_time": 1577029115
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/userinfo\/test": {
            "get": {
                "summary": "接口调试接入点",
                "tags": [
                    "账号信息查询"
                ],
                "description": "镜像返回客户端请求参数等信息",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "action",
                        "in": "query",
                        "description": "调试方式",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "test",
                            "description": "调试方式"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "req_ip": {
                                            "type": "string",
                                            "example": "61.129.101.51",
                                            "description": "客户端IP"
                                        },
                                        "test_id": {
                                            "type": "string",
                                            "example": "1710406932_65f2bd147ecd6",
                                            "description": "测试实例ID"
                                        },
                                        "req_param": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            },
                                            "example": "[]",
                                            "description": "客户端请求参数"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "req_ip": "61.129.101.51",
                                        "test_id": "1710406932_65f2bd147ecd6",
                                        "req_param": {
                                            "key": "63520**************6aeb",
                                            "test": "测试"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "接口调试接入点",
                "tags": [
                    "账号信息查询"
                ],
                "description": "镜像返回客户端请求参数等信息",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "action": {
                                        "type": "string",
                                        "example": "test",
                                        "description": "调试方式"
                                    }
                                },
                                "required": [
                                    "key",
                                    "action"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "req_ip": {
                                            "type": "string",
                                            "example": "61.129.101.51",
                                            "description": "客户端IP"
                                        },
                                        "test_id": {
                                            "type": "string",
                                            "example": "1710406932_65f2bd147ecd6",
                                            "description": "测试实例ID"
                                        },
                                        "req_param": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            },
                                            "example": "[]",
                                            "description": "客户端请求参数"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "req_ip": "61.129.101.51",
                                        "test_id": "1710406932_65f2bd147ecd6",
                                        "req_param": {
                                            "key": "63520**************6aeb",
                                            "test": "测试"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}