GET /get/v2/a2s-server
...大约 6 分钟约 1803 字
A2S 获取服务器信息
使用 A2S 协议获取起源游戏服务器信息,需要 UDP 请求,可能被屏蔽。
Query
format string
输出格式,默认为 json,可选值为 json、xml
- 默认:
json - 示例:
json
port integer
端口号,默认为 27015
- 默认:
27015 - 示例:
27015
hostname string 必填
主机名,必填
- 示例:
example.com
Responses
200
服务器信息
Body
application/json
botsinteger | nulldatastring | nullgamestring | nullgame_idintegermapstring | nullplayersstring | nullportinteger | nullprotocolinteger | nullserver_osstring | nullsuccessboolean 必填titlestring | nullvacboolean | nullversionstring | nullvisibilityboolean | null
{
"bots": 0,
"data": "string",
"game": "string",
"game_id": 0,
"map": "string",
"players": "string",
"port": 0,
"protocol": 0,
"server_os": "string",
"success": true,
"title": "string",
"vac": true,
"version": "string",
"visibility": true
}application/xml
botsinteger | nulldatastring | nullgamestring | nullgame_idintegermapstring | nullplayersstring | nullportinteger | nullprotocolinteger | nullserver_osstring | nullsuccessboolean 必填titlestring | nullvacboolean | nullversionstring | nullvisibilityboolean | null
<root>
<bots>0</bots>
<data>string</data>
<game>string</game>
<game_id>0</game_id>
<map>string</map>
<players>string</players>
<port>0</port>
<protocol>0</protocol>
<server_os>string</server_os>
<success>true</success>
<title>string</title>
<vac>true</vac>
<version>string</version>
<visibility>true</visibility>
</root>400
参数错误
Body
application/json
botsinteger | nulldatastring | nullgamestring | nullgame_idintegermapstring | nullplayersstring | nullportinteger | nullprotocolinteger | nullserver_osstring | nullsuccessboolean 必填titlestring | nullvacboolean | nullversionstring | nullvisibilityboolean | null
{
"bots": 0,
"data": "string",
"game": "string",
"game_id": 0,
"map": "string",
"players": "string",
"port": 0,
"protocol": 0,
"server_os": "string",
"success": true,
"title": "string",
"vac": true,
"version": "string",
"visibility": true
}application/xml
botsinteger | nulldatastring | nullgamestring | nullgame_idintegermapstring | nullplayersstring | nullportinteger | nullprotocolinteger | nullserver_osstring | nullsuccessboolean 必填titlestring | nullvacboolean | nullversionstring | nullvisibilityboolean | null
<root>
<bots>0</bots>
<data>string</data>
<game>string</game>
<game_id>0</game_id>
<map>string</map>
<players>string</players>
<port>0</port>
<protocol>0</protocol>
<server_os>string</server_os>
<success>true</success>
<title>string</title>
<vac>true</vac>
<version>string</version>
<visibility>true</visibility>
</root>422
hostname 错误
Body
application/json
botsinteger | nulldatastring | nullgamestring | nullgame_idintegermapstring | nullplayersstring | nullportinteger | nullprotocolinteger | nullserver_osstring | nullsuccessboolean 必填titlestring | nullvacboolean | nullversionstring | nullvisibilityboolean | null
{
"bots": 0,
"data": "string",
"game": "string",
"game_id": 0,
"map": "string",
"players": "string",
"port": 0,
"protocol": 0,
"server_os": "string",
"success": true,
"title": "string",
"vac": true,
"version": "string",
"visibility": true
}application/xml
botsinteger | nulldatastring | nullgamestring | nullgame_idintegermapstring | nullplayersstring | nullportinteger | nullprotocolinteger | nullserver_osstring | nullsuccessboolean 必填titlestring | nullvacboolean | nullversionstring | nullvisibilityboolean | null
<root>
<bots>0</bots>
<data>string</data>
<game>string</game>
<game_id>0</game_id>
<map>string</map>
<players>string</players>
<port>0</port>
<protocol>0</protocol>
<server_os>string</server_os>
<success>true</success>
<title>string</title>
<vac>true</vac>
<version>string</version>
<visibility>true</visibility>
</root>500
获取服务器信息失败
Body
application/json
botsinteger | nulldatastring | nullgamestring | nullgame_idintegermapstring | nullplayersstring | nullportinteger | nullprotocolinteger | nullserver_osstring | nullsuccessboolean 必填titlestring | nullvacboolean | nullversionstring | nullvisibilityboolean | null
{
"bots": 0,
"data": "string",
"game": "string",
"game_id": 0,
"map": "string",
"players": "string",
"port": 0,
"protocol": 0,
"server_os": "string",
"success": true,
"title": "string",
"vac": true,
"version": "string",
"visibility": true
}application/xml
botsinteger | nulldatastring | nullgamestring | nullgame_idintegermapstring | nullplayersstring | nullportinteger | nullprotocolinteger | nullserver_osstring | nullsuccessboolean 必填titlestring | nullvacboolean | nullversionstring | nullvisibilityboolean | null
<root>
<bots>0</bots>
<data>string</data>
<game>string</game>
<game_id>0</game_id>
<map>string</map>
<players>string</players>
<port>0</port>
<protocol>0</protocol>
<server_os>string</server_os>
<success>true</success>
<title>string</title>
<vac>true</vac>
<version>string</version>
<visibility>true</visibility>
</root>504
获取服务器信息超时
Body
application/json
botsinteger | nulldatastring | nullgamestring | nullgame_idintegermapstring | nullplayersstring | nullportinteger | nullprotocolinteger | nullserver_osstring | nullsuccessboolean 必填titlestring | nullvacboolean | nullversionstring | nullvisibilityboolean | null
{
"bots": 0,
"data": "string",
"game": "string",
"game_id": 0,
"map": "string",
"players": "string",
"port": 0,
"protocol": 0,
"server_os": "string",
"success": true,
"title": "string",
"vac": true,
"version": "string",
"visibility": true
}application/xml
botsinteger | nulldatastring | nullgamestring | nullgame_idintegermapstring | nullplayersstring | nullportinteger | nullprotocolinteger | nullserver_osstring | nullsuccessboolean 必填titlestring | nullvacboolean | nullversionstring | nullvisibilityboolean | null
<root>
<bots>0</bots>
<data>string</data>
<game>string</game>
<game_id>0</game_id>
<map>string</map>
<players>string</players>
<port>0</port>
<protocol>0</protocol>
<server_os>string</server_os>
<success>true</success>
<title>string</title>
<vac>true</vac>
<version>string</version>
<visibility>true</visibility>
</root>