BF2S API

API Restrictions

The API may only be used a maximum of 48 times per day (twice per hour, if you please). This will not likely change unless you have a really compelling reason for me to change it. Stats don't update faster than that, so it should be sufficient.

API Usage

The API provides two operations and all data is returned in JSON format. The API can be fetched over regular HTTP or HTTPS. The HTTPS does NOT use a CA signed certificate -- basically, this means that your fetching application is going to complain about it not being verified. Go ahead and ignore that as the point of SSL here is the encryption, not the verified sender identity.

I highly recommend using the HTTPS variant of the urls in order to keep your API key safe (as the fetched url string itself is encrypted as part of the SSL transaction).

Full Player Details

The player profile returned is incredibly detailed and provides almost 100% of what you see presented on player profiles at BF2S. The Full Player Details can be accessed at this url:

https://bf2s.com/api/YOUR_KEY/player/PLAYER_ID

Leaderboard Details

The Leaderboard Details allows you to query up to 64 players for their brief stats. While the data you get back for each player is not nearly as complete as the Full Player Details lookup, it does cover the major essentials you would need to create a compelling Leaderboard. The leaderboard can accept a single PID or multiple PIDs separated by commas. The url is:

https://bf2s.com/api/YOUR_KEY/leaderboard/PLAYER_ID
or
https://bf2s.com/api/YOUR_KEY/leaderboard/PLAYER_ID,PLAYER_ID,PLAYER_ID,PLAYER_ID[,...]

API Format Exploration

If you'd like to explore the format of the returned results, I put together a basic JSON data exploder. Just copy and past the JSON data into the big text aread and hit "Test" and page will spit the data in a more readable format.

API Signup

If you'd like to use the BF2S API you MUST have a valid key. Requests to the API without a valid key will be denied. If you'd like a key, please email me at api-key-request aht bf2s . com. Include who you are and what you'd like to do with the key in some decent amount of detail.