Go Back   Savage 2: A Tortured Soul Forum > Savage 2 Modding > Documentation

Notices

Documentation Post useful tutorials and other informative material.

Reply
 
Thread Tools Display Modes
Old 06-12-2011, 08:52 AM   #1
eaxs

eaxs's Avatar
 
Join Date: May 2008
Location: Germany
Posts: 2,611
Thanks: 9
Thanked 40 Times in 24 Posts
Exclamation PlaySavage2.com API

The PlaySavage2.com API allows you to fetch data from the playsavage2.com database. The data you'll receive is in encoded in JSON format. Most programming and scripting languages will provide you with the tools to parse and work with this data format. New interfaces will be added further down the road.


What you can do with the data
Just about anything you can imagine. You could, for example, create your own ladder system. Or you could create custom profile signature images showing your latest stats. Be creative!


How it works
All you have to do is send the approriate HTTP request to http://playsavage2.com. The site will then return a response with either the data or an error in JSON format. At this point there is no need for (user) authentication in order to use the API. All data is exposed to the public.


Player Stats Interface
API Call:
HTML Code:
http://playsavage2.com/index.php?option=com_stats&view=player&id=<account_id>&format=json
Example:
HTML Code:
http://playsavage2.com/index.php?option=com_stats&view=player&id=313136&format=json
Retrieves all statistics from a player. You must provide a valid Savage 2 account ID in the query (see <account_id>). The data returned is raw database information and is not modified by the PlaySavage2 ladder (although current ladder rankings are included in the response). Should the requested account not exist, "error" will be "404". Otherwise, a valid response will have the following structure:
  • version // Response version
  • acount // Player account id
  • name // Player name
  • error // Error code, whereas 0 means no error
  • ladder // Stats-summary of the last 30 days
    • player // Action player stats*
    • comm // Commander stats*
  • lifetime // Lifetime statistics
    • player // Action player stats*
    • comm // Commander stats*
*Stats Legend:
k = Kills, d = Deaths, a = Assists, s = Souls Spent, np = NPC's Killed, g = Gold Collected, cn = Clan Name, cdate = In Database Since, mdate = Last updated


Server List Interface
API Call:
HTML Code:
http://playsavage2.com/index.php?option=com_servers&view=list&format=json
Example: Not available

Retrieves information about all servers, including player ID's and names. There are no additional parameters you can send at this point. Should the server list be empty, "error" will be "404" in the response. A proper response has the following structure:
  • version // Response version
  • error // Error code, whereas 0 means no error
  • list // Holds the server list data

Last edited by eaxs; 06-12-2011 at 09:12 AM.
eaxs is offline   Reply With Quote
Old 06-12-2011, 10:28 AM   #2
SonOfAthena

SonOfAthena's Avatar
 
Join Date: Jul 2010
Posts: 6,035
Thanks: 7,047
Thanked 199 Times in 166 Posts
Default

You're really asking for a hacker to come and do his thing, aren't you?
SonOfAthena is offline   Reply With Quote
Old 06-12-2011, 12:00 PM   #3
eaxs

eaxs's Avatar
 
Join Date: May 2008
Location: Germany
Posts: 2,611
Thanks: 9
Thanked 40 Times in 24 Posts
Default

I know boubbin will have use for this data. That's at least person for now. Who knows what the future brings and what ideas emerge
eaxs is offline   Reply With Quote
Old 06-12-2011, 03:32 PM   #4
SonOfAthena

SonOfAthena's Avatar
 
Join Date: Jul 2010
Posts: 6,035
Thanks: 7,047
Thanked 199 Times in 166 Posts
Default

Ok. ^^
SonOfAthena is offline   Reply With Quote
Old 08-26-2011, 12:34 AM   #5
Tenerife

Tenerife's Avatar
 
Join Date: Nov 2009
Location: Tenerife
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I was using boubbin stats service. Is there a public API for get date like spawned units? I'm working in a Phd about social network and is nice use the game where I play.
__________________
Tenerife is offline   Reply With Quote
Old 08-30-2011, 02:05 PM   #6
eaxs

eaxs's Avatar
 
Join Date: May 2008
Location: Germany
Posts: 2,611
Thanks: 9
Thanked 40 Times in 24 Posts
Default

This API is not related to boubbin's work. We're not tracking in-game activity in detail, sorry.
eaxs is offline   Reply With Quote
Old 08-30-2011, 05:27 PM   #7
boubbin

boubbin's Avatar
 
Join Date: Jan 2009
Location: Espoo, Finland
Posts: 279
Thanks: 5
Thanked 38 Times in 22 Posts
Default

Quote:
Originally Posted by Tenerife View Post
I was using boubbin stats service. Is there a public API for get date like spawned units? I'm working in a Phd about social network and is nice use the game where I play.
i can give you a read access to that database, but not now, bug me later about that! :P in IRC pls
__________________

boubbin is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 05:41 AM.