Crysis 3 Stats JSON API
This API can be used by software engineers to integrate Crysis 3 Stats into their software.
If you use this API, please set a link back to crysis3s.com like: Powered by crysis3s.com
We think commercial use of this API is not fair.
You can get further information and help in our Forum
Flag icons can you find there: famfamfam.com Flag Icons
Accessing the API
http://api.crysis3s.com/[Platform]/[DataGroup]/
As
[DataGroup]
you can use following:
- playerlist
- player
- onlinestats
- playerupdate *(for registered apps)
- playerlookup *(for registered apps)
- setupkey *(for registered apps)
- getkey *(for registered apps)
I recommend to access this API via. cronjobs.
If your request was processed by the API, you get HTTP STATUS 200. If your request was not handled by our API you get HTTP STATUS 500.
You can use this PHP Example to begin.
DataGroups
-
output
defines the output format. This isjson
by default. You can also choosejs
,lines
,sig
playerlist
URL:http://api.crysis3s.com/[Platform]/playerlist/
[Platform]
can be pc
, 360
or ps3
POST parameters:
-
players
* is a required list of player names.
The list can be comma separated, or a JSON Array or a URI encoded array -
opt
is a list of [playerOutputOptions]
See below for a list of [playerOutputOptions].
Return parameters:
-
status
can containok
orerror
-
error
is only returned ifstatus
iserror
with one of following error codes:
invalid_platform, no_players_given, no_valid_players, index_database_error, data_database_error, too_many_players, private -
list
is the list of players data with index name equal your requested name. Every item hasstatus
with following codes:
pifound
only the index data of the player was found
data
complete data of the player was found
-
failed
is a list of failed players with index name equal your requested name. An item has at leasterror
with one of the following codes: invalid_name, notfound
player
URL:http://api.crysis3s.com/[Platform]/player/
[Platform]
can be pc
, 360
or ps3
POST parameters:
-
player
name of a player -
opt
is a list of [playerOutputOptions]
See below for a list of [playerOutputOptions].
Return parameters:
-
status
can containpifound
,data
,notfound
orerror
pifound
only the index data of the player was found
data
complete data of the player was found
-
error
is only returned ifstatus
iserror
with one of following error codes:
invalid_platform, invalid_name, private
onlinestats
URL:http://api.crysis3s.com/[Platform]/onlinestats/
[Platform]
must be global
POST parameters:
noneReturn parameters:
-
status
can containok
,nodata
orerror
ok
online data is available
nodata
data is not available
-
error
is only returned ifstatus
iserror
with one of following error codes:
invalid_platform -
pc
count of online players on PC -
360
count of online players on 360 -
ps3
count of online players on PS3
playerupdate *(for registered apps)
URL:http://api.crysis3s.com/[Platform]/playerupdate/
[Platform]
can be pc
, 360
or ps3
playerupdate
is a signed request.
Use this request to update a player. This means we request the current data from EA for this player.
If the player was not in our database, we do automatically a lookup and add the player.
signed request parameters:
-
time
timestamp in seconds -
ident
Unique ident of your app -
player
name of a player -
type
type of request can be:cronjob
,direct
cronjob
. You are only allowed to use direct
, if the update is
requested by an real person.
Return parameters:
-
status
can containerror
,added
,notfound
,pifound
,nobackend
,timedout
,noplatform
,noname
,nopid
,noworker
,exists
,full
,task
,notask
-
error
is only returned ifstatus
iserror
and can containinvalid_platform
,invalid_time
,invalid_name
,over_update_limit
,no_update_right
,noresponse
,invalid_request
,invalid_ident
,ident_not_found
,ident_locked
,signature_wrong
,invalid_json_data
-
pos
if thestatus
isadded
orexists
this is the queue position. If the update is in progress or finished,pos
will be negative.
-
task
is only returned ifstatus
isadded
,task
orexists
task.state
can containqueued
,started
,finished
task.result
can contain after task.state is finished:notfound
,found
Limiting
This request is limited for your app key.Only requests which result in status=added are counted towards your update limit.
The limit is counted per hour. The counter gets reseted 60 minutes after your first request.
How playerupdate can be used
If you requested a player from DataGroupplayer
or playerlist
and the stats are too old you can call playerupdate
.
If you get status=added you can call playerupdate
every 10 seconds to get the current status of your update. You can stop if task.state is finished. Then check task.result. If found
, the update was successful.
playerlookup *(for registered apps)
URL:http://api.crysis3s.com/[Platform]/playerlookup/
[Platform]
can be pc
, 360
or ps3
playerlookup
is a signed request.
Use this request to lookup a player. This means we request the current index data(playerid, name, country) from EA for this player.
You can use this to search a player if the player is not in our database. So use player
datagroup first to look if the player is in our database.
On a lookup always follows automatically an update of the player. This means you don't need to use playerupdate after playerlookup.
signed request parameters:
-
time
timestamp in seconds -
ident
Unique ident of your app -
player
name of a player
Return parameters:
-
status
can containerror
,added
,notfound
,pifound
,nobackend
,timedout
,noplatform
,noname
,noworker
,exists
,full
,task
,notask
-
error
is only returned ifstatus
iserror
and can containinvalid_platform
,invalid_time
,invalid_name
,over_update_limit
,no_update_right
,noresponse
,invalid_request
,invalid_ident
,ident_not_found
,ident_locked
,signature_wrong
,invalid_json_data
-
pos
if thestatus
isadded
orexists
this is the queue position. If the lookup is in progress or finished,pos
will be negative.
-
task
is only returned ifstatus
isadded
,task
orexists
task.state
can containqueued
,started
,finished
task.result
can contain after task.state is finished:notfound
,found
Limiting
This request is limited for your app key.Only requests which result in status=added are counted towards your lookup limit.
The limit is counted per hour. The counter gets reseted 60 minutes after your first request.
How playerlookup can be used
If you requested a player from DataGroupplayer
or playerlist
and the stats are not found call playerlookup
.
If you get status=added you can call playerlookup
every 10 seconds to get the current status of your lookup. You can stop if task.state is finished. Then check task.result. If found
, the lookup was successful.
setupkey *(for registered apps)
URL:http://api.crysis3s.com/[Platform]/setupkey/
[Platform]
must be global
setupkey
is a signed request.
If your app has the right to generate keys, you can do it with this request.
You should use this if a software runs at the users device like mobile apps, or desktop applications.
So you can generate an individual key for every installation. This is important, because you should never give your secret key out to another system.
signed request parameters:
-
time
timestamp in seconds -
ident
Unique ident of your app -
clientident
*(optional) New unique ident to create. If not given, we define a random string for this. -
name
*(optional) name for the new key. Get's displayed in your key overview just for information.
Return parameters:
-
status
can containerror
,ok
-
error
is only returned ifstatus
iserror
and can containinvalid_platform
,invalid_time
,no_genkey_right
,invalid_clientident
,invalid_name
,clientident_in_use
,db_save_error
,invalid_request
,invalid_ident
,ident_not_found
,ident_locked
,signature_wrong
,invalid_json_data
ident
Ident of your new keyparent
Parent ident(your app ident) of your new keykey
Your new keyname
Name of your new keylocked
Is the key locked, true or false. Will be always true for creation.canupdate
Has right to update, true or falsecanlookup
Has right to lookup, true or falseupdate_limit
count of allowed updates per hourlookup_limit
count of allowed lookups per hour
getkey *(for registered apps)
URL:http://api.crysis3s.com/[Platform]/getkey/
[Platform]
must be global
getkey
is a signed request.
This request can be used to get information about a existing client key or your own key.
signed request parameters:
-
time
timestamp in seconds -
ident
Unique ident of your app -
clientident
Ident to lookup
Return parameters:
-
status
can containerror
,ok
-
error
is only returned ifstatus
iserror
and can containinvalid_platform
,invalid_time
,invalid_clientident
,clientident_notfound
,clientident_notallowed
,invalid_request
,invalid_ident
,ident_not_found
,ident_locked
,signature_wrong
,invalid_json_data
ident
Ident of your keyparent
Parent ident(your app ident) of your keykey
Your keyname
Name of your keylocked
Is the key locked, true or false.canupdate
Has right to update, true or falsecanlookup
Has right to lookup, true or falseupdate_limit
count of allowed updates per hourlookup_limit
count of allowed lookups per hourupdate_left
count of allowed updates per hour leftlookup_left
count of allowed lookups per hour left
playerOutputOptions
We have two different types of options: presets and every single option.
Presets
-
clear
sets all options to false -
index
returns only index data, all other options are ignored -
all
is the default option with nextranks:true and imgInfo:true
Options
general
default: truenextranks
default: falserank
default: trueimgInfo
default: falselastseen
default: falseurls
default: falseprogInfo
default: false (Calculates progress percentages)desc
default: false (Activates descriptions of items)skills
default: truedamagetypes
default: truedogtags
default: trueperks
default: trueweapons
default: truemaps
default: truesuitmodes
default: truemodes
default: truekills
default: falseranking
default: falserankingInfo
default: true
Order how the options are executed
- Options default values
- presets
- options
Value of opt
POST parameter
The value of the opt
POST parameter can be a comma separated list or a JSON object.All options given in a comma separated list will be set to true.
Examples
- opt=clear,coop,imgInfo
- opt={"clear"%3Atrue%2C"coop"%3Atrue%2C"imgInfo"%3Atrue}
signed request
A signed request is a POST request with two POST parameters data
and sig
.
Basicly you need to generate a signature with the data and your secret key.
To get your secret key, you need to register your app
POST parameters
data
is a base64url encoded JSON object of signed request parameterssig
is a base64url encoded SHA256 hmac signature ofdata
and your secret key
Example
This PHP Example shows you all 4 types of signed requests you can do.Note: The timestamp you give us with signed request parameters should not have more than 1 minute difference to current time. So the time on your server should be correct.