GameAPIs

Battlefield: Bad Company 2 Documentation

Parameters

Required Parameter Type Description Default Value
True IP String Server's IP address or domain None
False Port Integer The port of which the game server is running on. 19567

Single Server

GET https://use.gameapis.net/bfbc2/query/status/{IP}:{PORT}
{
    "status": true,
    "hostname": "{IP}",
    "port": {PORT},
    "queryPort": {PORT + 29321},
    "protocol": "tcp",
    "cached": false
}

Multiple Servers

GET https://use.gameapis.net/bfbc2/query/status/{IP}:{PORT},{IP2}:{PORT2}
{
    "{IP}:{PORT}": {
        "status": true,
        "hostname": "{IP}",
        "port": {PORT},
        "queryPort": {PORT + 29321},
        "protocol": "tcp",
        "cached": false
    },
    "{IP2}:{PORT2}": {
        "status": true,
        "hostname": "{IP2}",
        "port": {PORT2},
        "queryPort": {PORT2 + 29321},
        "protocol": "tcp",
        "cached": false
    }
}

Single Server

GET https://use.gameapis.net/bfbc2/query/players/{IP}:{PORT}
{
    "status": true,
    "hostname": "{IP}",
    "port": {PORT},
    "queryPort": {PORT + 29321},
    "protocol": "tcp",
    "players": {
        "online": 1,
        "max": 100,
        "list": [
            {
                "clanTag": "*",
                "name": "Douvdevan",
                "guid": "",
                "teamId": "2",
                "squadId": "2",
                "kills": "0",
                "deaths": "0",
                "score": "0",
                "ping": "99"
            }
        ]
    },
    "cached": false
}

Multiple Servers

GET https://use.gameapis.net/bfbc2/query/players/{IP}:{PORT},{IP2}:{PORT2}
{
    "{IP}:{PORT}": {
        "status": true,
        "hostname": "{IP}",
        "port": {PORT},
        "queryPort": {PORT + 29321},
        "protocol": "tcp",
        "players": {
            "online": 0,
            "max": 100,
            "list": null
        },
        "cached": false
    },
    "{IP2}:{PORT2}": {
        "status": true,
        "hostname": "{IP2}",
        "port": {PORT2},
        "queryPort": {PORT2 + 29321},
        "protocol": "tcp",
        "players": {
            "online": 1,
            "max": 100,
            "list": [
                {
                    "clanTag": "*",
                    "name": "Douvdevan",
                    "guid": "",
                    "teamId": "2",
                    "squadId": "2",
                    "kills": "0",
                    "deaths": "0",
                    "score": "0",
                    "ping": "99"
                }
            ]
        },
        "cached": false
    }
}

Single Server

GET https://use.gameapis.net/bfbc2/query/info/{IP}:{PORT}
{
    "status": true,
    "hostname": "{IP}",
    "port": {PORT},
    "queryPort": {PORT + 29321},
    "protocol": "tcp",
    "name": "BFBC2 Server",
    "version": "851434",
    "players": {
        "online": 1,
        "max": 100,
        "list": [
            {
                "clanTag": "*",
                "name": "Douvdevan",
                "guid": "",
                "teamId": "2",
                "squadId": "2",
                "kills": "0",
                "deaths": "0",
                "score": "0",
                "ping": "99"
            }
        ]
    },
    "cached": false
}

Multiple Servers

GET https://use.gameapis.net/bfbc2/query/info/{IP}:{PORT},{IP2}:{PORT2}
{
    "{IP}:{PORT}": {
        "status": true,
        "hostname": "{IP}",
        "port": {PORT},
        "queryPort": {PORT + 29321},
        "protocol": "tcp",
        "name": "BFBC2 Server",
        "version": "851434",
        "players": {
            "online": 0,
            "max": 100,
            "list": null
        },
        "cached": false
    },
    "{IP2}:{PORT2}": {
        "status": true,
        "hostname": "{IP2}",
        "port": {PORT2},
        "queryPort": {PORT2 + 29321},
        "protocol": "tcp",
        "name": "BFBC2 Server",
        "version": "851434",
        "players": {
            "online": 1,
            "max": 100,
            "list": [
                {
                    "clanTag": "*",
                    "name": "Douvdevan",
                    "guid": "",
                    "teamId": "2",
                    "squadId": "2",
                    "kills": "0",
                    "deaths": "0",
                    "score": "0",
                    "ping": "99"
                }
            ]
        },
        "cached": false
    }
}