Battlefield 4
Battlefield 4 endpoints are available at https://api.bflist.io/v2/bf4/
.
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": 682,
"players": 6174
}
List servers#
Get a paginated list of currently available servers.
GET /servers HTTP/1.1
Incomplete servers
Some servers may only have a limited set of attributes available.
In these cases, the _completeInfo
property will be set to false
.
For more information, see this section.
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": "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
],
"cursor": "4c379877-b1f0-4534-8a4c-627d9503de9e",
"hasMore": true
}
Get a server#
Retrieve a single server.
GET /servers/{ip}:{port} HTTP/1.1
Incomplete servers
Some servers may only have a limited set of attributes available.
In these cases, the _completeInfo
property will be set to false
.
For more information, see this section.
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": "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#
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
{
"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#
Get the server a player is currently playing on.
GET /players/{name}/server HTTP/1.1
Incomplete servers
Some servers may only have a limited set of attributes available.
In these cases, the _completeInfo
property will be set to false
.
For more information, see this section.
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": "6b7db99d-583c-4375-bb98-1e9a486eabec",
"ip": "104.153.105.96",
"port": 25200,
"name": "# -bZ3- # CONQUEST LARGE BANZORE.COM",
"numPlayers": 7,
"maxPlayers": 64,
"map": "MP_Siege",
"mapLabel": "Siege Of Shanghai",
"gameType": "ConquestLarge",
"roundsPlayed": 0,
"roundsTotal": 1,
"targetScore": 0,
"password": false,
"ranked": true,
"punkbuster": true,
"punkbusterVersion": "v1.905 | A1390 C2.351",
"joinQueue": true,
"quickmatch": false,
"uptime": 17382,
"roundTime": 1112,
"region": "NAm",
"country": "US",
"pingSite": "lax",
"version": "179665",
"teams": [
{
"tickets": 695.079468
},
{
"tickets": 834.2363
}
],
"players": [
{
"name": "iastrochung",
"team": 1,
"squad": 1,
"squadLabel": "Alpha",
"kills": 2,
"deaths": 4,
"score": 3457,
"rank": 140,
"rankLabel": "General",
"ping": 197,
"type": 0,
"typeLabel": "Player"
},
// more players
],
"_completeInfo": true
}
Incomplete servers#
Battlefield 4 servers can be updated in two ways:
- Directly, by retrieving data from the game server itself.
- Via Battlelog snapshots, if direct communication with the game server fails.
Direct querying provides more detailed information. As a result, Battlelog snapshots are only used as a fallback when direct querying isn't possible.
Each server object has a boolean property called _completeInfo
to indicate whether it includes the full set of properties.
- If
_completeInfo
istrue
, the server has all the usual properties. - If
_completeInfo
isfalse
, only a limited set of properties is available. The following properties will be missing:roundsPlayed
,roundsTotal
,targetScore
,password
,ranked
,punkbuster
,punkbusterVersion
,joinQueue
,quickmatch
,uptime
,region
,country
,pingSite
,version
,teams
.