Battlefield 4
Battlefield 4 endpoints are available at https://api.bflist.io/bf4/v1
.
Live stats#
Get the number of currently active players and servers in Battlefield 4.
GET /livestats
Response
200 OK
{
"servers": 682,
"players": 6174
}
Get a page from the list of servers#
Per default, we send 50 servers per page. You can set a custom page size betweeen 20 and 100 via an optional perPage
query parameter.
GET /servers/:page
Note: Some servers only contain a limited set of attributes. For these servers, _completeInfo
will be set to false
. More details below.
Response
200 OK
X-Total-Pages: 13
[
{
"guid": "18b3fdf2-11c5-4156-8175-8553e2f50576",
"ip": "94.250.208.28",
"port": 25200,
"name": "SUPER@ [SiC] S3 Second Assault / Final Stand Conquest All Maps",
"numPlayers": 64,
"maxPlayers": 64,
"map": "XP0_Firestorm",
"mapLabel": "Op. Firestorm 2014",
"gameType": "ConquestLarge",
"roundsPlayed": 1,
"roundsTotal": 1,
"targetScore": 0,
"password": false,
"ranked": true,
"punkbuster": true,
"punkbusterVersion": "v1.905 | A1390 C2.351",
"joinQueue": true,
"quickmatch": false,
"uptime": 38222,
"roundTime": 1902,
"region": "EU",
"country": "DE",
"pingSite": "ams",
"version": "179665",
"teams":
[
{
"tickets": 163.133789
},
{
"tickets": 133.308365
}
],
"players":
[
{
"name": "HorseVengeance",
"team": 2,
"squad": 7,
"squadLabel": "Golf",
"kills": 4,
"deaths": 4,
"score": 1788,
"rank": 140,
"rankLabel": "General",
"ping": 175,
"type": 0,
"typeLabel": "Player"
},
// more players
],
"_completeInfo": true
},
{
"guid": "bd860787-4163-4467-9d4f-cd468a520fd5",
"ip": "185.50.104.69",
"port": 25501,
"name": "Battlefield da Depressao - LOCKER 24/7 50Hz - i3D.net",
"numPlayers": 61,
"maxPlayers": 64,
"map": "MP_Prison",
"mapLabel": "Operation Locker",
"gameType": "Obliteration",
"roundTime": 967,
"players":
[
{
"name": "GuiksOfficial",
"team": "0",
"squad": 0,
"squadLabel": "No squad",
"kills": 0,
"deaths": 0,
"score": 0,
"rank": 10,
"rankLabel": "Lance Corporal V",
"ping": -1,
"type": 0,
"typeLabel": "Player"
},
// more players
],
"_completeInfo": false
},
// more servers
]
Get a server's details#
GET /servers/:ip::port
Note: You can also access each property individually. For example, GET /servers/:ip::port/name
will return only the server's name as plain text. Complex properties (gameExpansions, extendedInfo, settings, maps, slots, teams, players) are returned as JSON. So, GET /servers/:ip::port/players
will return a JSON array of players on the server.
Note: Some servers only contain a limited set of attributes. For these servers, _completeInfo
will be set to false
. More details below.
Response
200 OK
{
"guid": "4b2e867a-058b-4f81-b5c9-a84b41777310",
"ip": "94.250.199.131",
"port": 25200,
"name": "5 ### | Pizza Party | ### | INFANTRY MIXMODES VANILLA | EPS 60",
"numPlayers": 45,
"maxPlayers": 64,
"map": "MP_Resort",
"mapLabel": "Hainan Resort",
"gameType": "Domination",
"roundsPlayed": 1,
"roundsTotal": 2,
"targetScore": 0,
"password": false,
"ranked": true,
"punkbuster": true,
"punkbusterVersion": "v1.905 | A1390 C2.351",
"joinQueue": true,
"quickmatch": false,
"uptime": 20361,
"roundTime": 99,
"region": "EU",
"country": "DE",
"pingSite": "ams",
"version": "179665",
"teams":
[
{
"tickets": 489
},
{
"tickets": 454.5987
}
],
"players":
[
{
"name": "Liquid-LCS",
"team": 2,
"squad": 1,
"squadLabel": "Alpha",
"kills": 0,
"deaths": 1,
"score": 150,
"rank": 140,
"rankLabel": "General",
"ping": 53,
"type": 0,
"typeLabel": "Player"
},
// more players
],
"_completeInfo": true
}
Get a player's details#
GET /players/:name
Player type is one of: player (0
), spectator(1
), commander (2
).
Note: You can also access each property individually. For example, GET /players/:name/score
will return only the players's current score as plain text.
Response
200 OK
{
"name": "Thelolwut7",
"team": 2,
"squad": 6,
"squadLabel": "Foxtrot",
"kills": 18,
"deaths": 9,
"score": 5049,
"rank": 64,
"rankLabel": "Chief Warrant Officer Three IV",
"ping": 58,
"type": 0,
"typeLabel": "Player"
}
Get a player's current server's details#
GET /players/:name/server
Please see the section on getting an individual server's details, as this endpoint's features and response structure are identical.
Incomplete servers#
Battlefield 4 servers can be updated in two different ways. Either directly, by retrieving data from the game server itself, or via Battlelog snapshots. However, a lot more details are available when querying the server directly. Hence Battlelog snapshots are only used if the direct communication with the game server fails.
To indicate whether a server has the complete set of properties available, each server object contains a boolean property: _completeInfo
. If _completeInfo
is true
, the server contains all the usual properties. If, however, _completeInfo
is false
, the server only contains a limited set of properties. The following properties will be missing: roundsPlayed
, roundsTotal
, targetScore
, password
, ranked
, punkbuster
, punkbusterVersion
, joinQueue
, quickmatch
, uptime
, region
, country
, pingSite
, version
, teams
.