Forgotten Hope 2
Forgotten Hope 2 endpoints are available at https://api.bflist.io/v2/bf2/
.
Separate endpoints for a mod#
While Forgotten Hope 2 is a Battlefield 2 mod on a technical level, it might as well be a separate game. The mod uses its own GameSpy-replacement backend, which keeps a completely separate server list, login system and tracks stats for players. Because of the separate backend, you would not find any of the servers or players when looking at the other Battlefield 2 GameSpy-replacements (BF2Hub/PlayBF2).
To avoid confusion, Forgotten Hope 2 is tracked as a separate game with separate API endpoints.
Live stats#
Retrieve the current number of active players and servers.
GET /livestats HTTP/1.1
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"servers": 10,
"players": 76
}
List servers#
Get a paginated list of currently available servers.
Since servers for older Battlefield games do not have a guid, one is generated using the server's ip and port. The generated guid is bflist-specific and neither known to nor returned by the server.
GET /servers HTTP/1.1
Parameters
param | Description |
---|---|
cursor | Pagination cursor (optional, required if after is set) |
after | Pagination marker (optional) |
perPage | Number of items per page (optional, default: 50) |
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"servers": [
{
"guid": "1cdf0d6-8e93060-e259d9-d278c55",
"ip": "88.198.61.241",
"port": 16567,
"queryPort": 29900,
"name": "[PlayFH2]RANKED #1 FH2.63 [100p]",
"numPlayers": 1,
"maxPlayers": 100,
"password": false,
"gameType": "gpm_cq",
"mapName": "Giarabub",
"mapSize": 16,
"gameVersion": "1.5.3153-802.0",
"gameVariant": "fh2",
"timelimit": 3600,
"roundsPerMap": 1,
"ranked": true,
"anticheat": true,
"battlerecorder": true,
"demoIndex": "http://",
"demoDownload": "http://",
"voip": true,
"autobalance": false,
"friendlyfire": true,
"tkmode": "No Punish",
"startdelay": 25,
"spawntime": 15,
"sponsorText": "stats.playfh2.net",
"sponsorLogoUrl": "http://i.imgur.com/Z03y4s8.png",
"communityLogoUrl": "http://i.imgur.com/Z03y4s8.png",
"scorelimit": 0,
"ticketratio": 200,
"teamratio": 100,
"team1": "IT",
"team2": "AU",
"pure": false,
"globalUnlocks": true,
"reservedSlots": 0,
"dedicated": true,
"os": "linux-64",
"bots": false,
"fps": 36,
"plasma": false,
"coopBotRatio": 0,
"coopBotCount": 0,
"coopBotDiff": 0,
"noVehicles": false,
"teams": [
{
"index": 1,
"label": "IT"
},
{
"index": 2,
"label": "AU"
}
],
"players": [
{
"pid": 465201158,
"name": "erikwingco1",
"tag": "",
"score": 0,
"kills": 0,
"deaths": 0,
"ping": 215,
"team": 2,
"teamLabel": "AU",
"aibot": false
},
// more players
]
},
// more servers
],
"cursor": "4c379877-b1f0-4534-8a4c-627d9503de9e",
"hasMore": true
}
Get a server#
Retrieve a single server.
GET /servers/{ip}:{port} HTTP/1.1
Parameters
param | Description |
---|---|
ip | Server's (public) IP address |
port | Server's game port |
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"guid": "202ba49-7dfcb1c-9003645-1a5d1ef",
"ip": "93.186.199.84",
"port": 16569,
"queryPort": 29900,
"name": "*Crazy Veterans* FH2 | Firing Range",
"numPlayers": 0,
"maxPlayers": 32,
"password": false,
"gameType": "gpm_cq",
"mapName": "Firing Range Plus",
"mapSize": 64,
"gameVersion": "1.5.3153-802.0",
"gameVariant": "fh2",
"timelimit": 3600,
"roundsPerMap": 1,
"ranked": false,
"anticheat": true,
"battlerecorder": false,
"demoIndex": "http://",
"demoDownload": "http://",
"voip": true,
"autobalance": false,
"friendlyfire": true,
"tkmode": "No Punish",
"startdelay": 10,
"spawntime": 9,
"sponsorText": "",
"sponsorLogoUrl": "",
"communityLogoUrl": "",
"scorelimit": 0,
"ticketratio": 200,
"teamratio": 100,
"team1": "DE",
"team2": "FR",
"pure": false,
"globalUnlocks": false,
"reservedSlots": 0,
"dedicated": true,
"os": "linux-64",
"bots": false,
"fps": 35,
"plasma": false,
"coopBotRatio": 0,
"coopBotCount": 0,
"coopBotDiff": 0,
"noVehicles": false,
"teams": [
{
"index": 1,
"label": "DE"
},
{
"index": 2,
"label": "FR"
}
],
"players": [
{
"pid": 464842463,
"name": "johnyfyy",
"tag": "",
"score": 23,
"kills": 9,
"deaths": 2,
"ping": 40,
"team": 1,
"teamLabel": "IT",
"aibot": false
},
// more players
]
}
Get a player#
Fetch a currently active player.
GET /players/{name} HTTP/1.1
Player Name Conflicts
In rare cases, two active players may have exactly the same name.
To avoid inconsistencies, the API responds with a 409 Conflict
error if a request refers to a player name that isn't unique.
Parameters
param | Description |
---|---|
name | Player's url-encoded name/nick (without any tag/prefix) |
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"pid": 465171966,
"name": "antoniooo",
"tag": "fhp22",
"score": 58,
"kills": 14,
"deaths": 3,
"ping": 229,
"team": 2,
"teamLabel": "AU",
"aibot": false
}
Get a player's current server#
Get the server a player is currently playing on.
GET /players/{name}/server HTTP/1.1
Parameters
param | Description |
---|---|
name | Player's url-encoded name/nick (without any tag/prefix) |
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"guid": "350d496-16cfd80-ae16385-92e234d",
"ip": "120.78.219.201",
"port": 16567,
"queryPort": 29900,
"name": "[CN]FH2.65 PVP&PVE SERVER",
"numPlayers": 22,
"maxPlayers": 32,
"mapName": "Mersa Matruh",
"mapSize": 64,
"password": false,
"gameType": "gpm_coop",
"gameVersion": "1.5.3153-802.0",
"gameVariant": "fh2",
"timelimit": 2700,
"roundsPerMap": 1,
"ranked": false,
"anticheat": false,
"battlerecorder": false,
"demoIndex": "",
"demoDownload": "",
"voip": true,
"autobalance": true,
"friendlyfire": false,
"tkmode": "No Punish",
"startdelay": 30,
"spawntime": 10,
"sponsorText": "",
"sponsorLogoUrl": "http://tiebapic.baidu.com/forum/w%3D580/sign=127c235cab315c6043956be7bdb0cbe6/258e3b292df5e0fe6ba706484b6034a85fdf724a.jpg",
"communityLogoUrl": "http://tiebapic.baidu.com/forum/w%3D580/sign=127c235cab315c6043956be7bdb0cbe6/258e3b292df5e0fe6ba706484b6034a85fdf724a.jpg",
"scorelimit": 0,
"ticketratio": 200,
"teamratio": 100,
"team1": "DE",
"team2": "GB",
"pure": false,
"globalUnlocks": false,
"reservedSlots": 0,
"dedicated": true,
"os": "win32",
"bots": true,
"fps": 0,
"plasma": false,
"coopBotRatio": 0,
"coopBotCount": 0,
"coopBotDiff": 0,
"noVehicles": false,
"teams": [
{
"index": 1,
"label": "DE"
},
{
"index": 2,
"label": "GB"
}
],
"players": [
{
"pid": 465232508,
"name": "Hanafunyuu",
"tag": "",
"score": 37,
"kills": 24,
"deaths": 0,
"ping": 22,
"team": 1,
"teamLabel": "DE",
"aibot": false
},
// more players
]
}