Team Website API now Available

We will announce new product updates here along with what features are being included in the updates
User avatar
FTMSupport
Site Admin
Posts: 13193
Joined: Sat Mar 28, 2009 7:25 pm

Team Website API now Available

Post by FTMSupport » Thu Nov 17, 2011 2:34 am

For any users of Team Websites for any of our iScore Products, there is now an API available to get access to the same raw data used to create the websites. This will allow you to integrate iScore Data into third party applications or custom websites for example.

Here is a link to the documentation:

http://api.iscorecentral.com/teamwebsiteapi.html" onclick="window.open(this.href);return false;


We will be announcing a contest shortly for users that come up with the best re-usable components or integrations with the API for use by the iScore community.

(Posting this same message in multiple forums to make sure the word gets out.)
Check out the new iScore Baseball documentation page!
Includes videos and user manual.
http://iscoresports.com/baseball/training.php#docs
70clcl
Posts: 49
Joined: Sun Nov 29, 2009 8:55 am

Re: Team Website API now Available

Post by 70clcl » Tue Nov 29, 2011 8:56 pm

This is awesome!!! I noticed that all of these XML responses are missing the associated league(s). Is there a way to identify games/players/teams associated with specific leagues? It seems like there should be a "league" attribute in all these responses that would have a comma-delimited list of associated leauge GUID's.

Also, a quick observation. I did a "leagues" report for my team (results below) and noticed that all of the "gameCount" attributes are listed as 99. Is this the maximum number that can be stored in this attribute, or is this a default counter of some sort?

<?xml version="1.0" encoding="UTF-8"?>
<LEAGUES fromcache="false" responseSeconds="0.902756929398" requestTime="November 29, 2011, 9:33 pm MST">
<LEAGUE name="Vipers" guid="06909BF2-13F2-47C9-BE83-D891D1FFE1EF" gameCount="99"/>
<LEAGUE name="2010" guid="09791418-2A1E-48CF-8C1C-99E4DB5CA47F" gameCount="99"/>
<LEAGUE name="Prospect Park 9/3/11" guid="0B1BF790-FD19-4A95-AB9E-4A46C7B868F7" gameCount="99"/>
<LEAGUE name="Spring Tuneup" guid="0C605C30-B4DF-438E-8460-775252F53847" gameCount="99"/>
<LEAGUE name="2011" guid="0D556FB9-3379-476F-9E30-76D5E06B74DB" gameCount="99"/>
<LEAGUE name="Noah" guid="0EADC3D2-49AD-4008-9C7F-B1ED6E4F7AA6" gameCount="99"/>
<LEAGUE name="Turkey Shootout" guid="192E3FBD-9D6F-48AD-A68D-D928AD7DB91E" gameCount="99"/>
<LEAGUE name="Madison" guid="1F5C9544-12B8-419B-93FC-5307E8DF8B95" gameCount="99"/>
<LEAGUE name="Bracket Play" guid="270774BF-A012-4B35-B71E-43CC53135D53" gameCount="99"/>
<LEAGUE name="Texas Blaze Fastpitch Express" guid="2A950F0C-60AB-44CC-BA9A-2F93194A447F" gameCount="99"/>
<LEAGUE name="Mid Morning (9:15 - 11:45 start Time)" guid="33CC3F05-07D6-4E92-BC56-6DA8037612BC" gameCount="99"/>
<LEAGUE name="CLASH Of Champions" guid="384AED41-2AB5-460B-AB4E-627BA2D176E5" gameCount="99"/>
<LEAGUE name="June Fest" guid="3D03F853-4BA5-495F-9EA5-2ACA45857ADC" gameCount="99"/>
<LEAGUE name="Early Morning (7 - 9 Start Time)" guid="460B4E00-1032-40FC-847C-D708BABF4225" gameCount="99"/>
<LEAGUE name="3rd Annual Valentines Day Bash at Huber Ranch" guid="4AED3712-1DE9-4EA4-8AE0-3076BCAB06F8" gameCount="99"/>
<LEAGUE name="Ronald McDonald Tournament" guid="4B88A590-A6F6-4FBA-97B5-FD2A6EB07CA1" gameCount="99"/>
<LEAGUE name="Summer" guid="6107E216-6CB4-4DBA-B104-AA8B5D4BA14D" gameCount="99"/>
<LEAGUE name="Evening" guid="65A14B7E-0E1E-4695-9A78-119B53377A3A" gameCount="99"/>
<LEAGUE name="32nd Annual AJF Invitational" guid="7453D16D-A425-4AAC-99B5-FEF7D3CF70D9" gameCount="99"/>
<LEAGUE name="Scrimmage" guid="75C0361A-A444-46D7-94F4-FFC7C47A12AE" gameCount="99"/>
<LEAGUE name="Prospect Park 8/20/11" guid="7D61FC5A-63FE-4B4A-A69E-F5FB34BE99C6" gameCount="99"/>
<LEAGUE name="Mother's Day 1-Day" guid="86A47277-F381-442E-9D3A-68EC5D2E48C3" gameCount="99"/>
<LEAGUE name="San Marcos 6/25/11" guid="892F0E77-B978-4C7B-9EE2-D42F7B2880CF" gameCount="99"/>
<LEAGUE name="Prospect Park 3/12/11" guid="8D76E45C-8DA3-4980-9C5C-4C7AD67EEFDF" gameCount="99"/>
<LEAGUE name="Fall" guid="9A69ECCE-AEAE-4A15-8F5F-21B40C45B56C" gameCount="99"/>
<LEAGUE name="Diamond Dog Summer Blowout" guid="9ECB1290-4949-474C-BDEB-E66C46E95C6E" gameCount="99"/>
<LEAGUE name="T&C 5/14/11" guid="A50D5A20-70DD-4F1E-B4AE-C9F286E89030" gameCount="99"/>
<LEAGUE name="Pool Play" guid="A655BB2D-CAEC-4F48-A4DD-B786FE21DDC4" gameCount="99"/>
<LEAGUE name="All" guid="ALL" gameCount="99"/>
<LEAGUE name="March Madness" guid="B1297216-9CFB-4CE1-A6F2-B308AE4D23AA" gameCount="99"/>
<LEAGUE name="Prospect Park Championship" guid="B70E581F-661B-461B-B1F6-8D6BFD2B5346" gameCount="99"/>
<LEAGUE name="City League" guid="BDE2AA0D-72D9-449A-A5F8-F4EF929226E8" gameCount="99"/>
<LEAGUE name="Afternoon (noon - 5)" guid="CE1A58C5-2D2E-4F6E-8131-5DDEDBF7EE22" gameCount="99"/>
<LEAGUE name="Default" guid="DEFAULT" gameCount="99"/>
<LEAGUE name="2009" guid="E8D48B50-93FF-4ABD-A917-2CB5A31021F9" gameCount="99"/>
<LEAGUE name="Fall Classic" guid="EF997904-1BA6-49F8-83F9-275747D14346" gameCount="99"/>
<LEAGUE name="San Marcos 6/11/2011" guid="F097F331-9BCC-46DE-A498-003632D4CA3F" gameCount="99"/>
<LEAGUE name="Battle of the Bats" guid="F24182FA-E772-4882-B8C5-3814A805A96E" gameCount="99"/>
<LEAGUE name="6th Annual Cotton Pickin' Classic" guid="F4CEDDF7-B1BC-484E-8648-52A5FD4B080D" gameCount="99"/>
<LEAGUE name="Winter" guid="F4DF903F-B78E-4ABC-8710-D91EA7FC8558" gameCount="99"/>
<LEAGUE name="Spring Classic" guid="F9EB07AA-362B-4676-8579-9B62D60E5324" gameCount="99"/>
<LEAGUE name="Spring" guid="FA6531A3-1C52-4DD3-AE6E-81EA6EF95D87" gameCount="99"/>
<LEAGUE name="Prospect Park 9/17/11" guid="FF17D5B5-2198-4E1D-BFDA-C7AF547D27A3" gameCount="99"/>
</LEAGUES>
User avatar
FTMSupport
Site Admin
Posts: 13193
Joined: Sat Mar 28, 2009 7:25 pm

Re: Team Website API now Available

Post by FTMSupport » Tue Nov 29, 2011 9:47 pm

The API does not show the leagues things are in... it works the opposite way. You can get a list of all the leagues, and when you run a stat query, you pass the set of GUIDs for the league(s) you want to include in your result.

Using your above example, if you want to see only stats for the "Spring" and "Winter" leagues combined, you would call:

cumulativestats.php?s=baseball&t=TTTT&p=PPPP&lg=FA6531A3-1C52-4DD3-AE6E-81EA6EF95D87,F4DF903F-B78E-4ABC-8710-D91EA7FC8558

(replacing TTTT and PPPP with your team and password. Notice the lg= with a comma separated list of league guids.

The gameCount had a bug --- it was showing all games on the device. If you try the call again, we have now fixed this, and you should see the game count for each league on your device.
Check out the new iScore Baseball documentation page!
Includes videos and user manual.
http://iscoresports.com/baseball/training.php#docs
70clcl
Posts: 49
Joined: Sun Nov 29, 2009 8:55 am

Re: Team Website API now Available

Post by 70clcl » Wed Nov 30, 2011 1:05 pm

Okay, I might be able to find something I can use this for.

I got really excited when I first saw this API announcement because I thought I would be able to finally group my group my stats/games the way I've wanted (using AND logic instead of OR logic). My hope was to get a list of the leagues using the "leagues" report, then use the "games" report to get a list of games inside given leagues (by passing league GUIDs similar to "cumulativestats" use of lg=[GUID,GUID,GUID]), and then using the "gamestats" report by passing the list of returned game GUIDs from the previous report. But, it doesn't sound like I will be able to do this, right?
User avatar
FTMSupport
Site Admin
Posts: 13193
Joined: Sat Mar 28, 2009 7:25 pm

Re: Team Website API now Available

Post by FTMSupport » Wed Nov 30, 2011 1:12 pm

We can add a parameter to the cumulativestats.php call where you can pass the specific list of games you want to get the summarized stats for.

You can then use the following logic:

1. Get your list of leagues with a call to leagues.php.

2. Then for the leagues you are interested in, call games.php passing lg=XXXX for each league you are interested in to get the list of games from that league (doing this one at a time)

3. Do whatever AND/OR logic you like to narrow down the game list to just a subset of games you are interested in.

4. Call cumulativestats.php and pass in the list of games determined in step 3.


Let us know if this will work for what your are trying to do and we can add a new parameter to allow this.
Check out the new iScore Baseball documentation page!
Includes videos and user manual.
http://iscoresports.com/baseball/training.php#docs
70clcl
Posts: 49
Joined: Sun Nov 29, 2009 8:55 am

Re: Team Website API now Available

Post by 70clcl » Wed Nov 30, 2011 5:39 pm

This sounds like exactly what I'm looking for.
Is lg=GUID a curent parameter to games.php? I tried using the following querystring but received an error. You can see that this is a valid league GUID by comparing it to my previous post where I dumped a list of my leagues.

games.php?t=TEAM&s=softball&p=PASSWD&lg=4B88A590-A6F6-4FBA-97B5-FD2A6EB07CA1

The error I got was this:
Fatal error: Call to a member function execute() on a non-object in /home/content/i/s/c/iscoreftp/html/api/teamwebsite/TWAPI.php on line 384
70clcl
Posts: 49
Joined: Sun Nov 29, 2009 8:55 am

Re: Team Website API now Available

Post by 70clcl » Wed Nov 30, 2011 5:46 pm

Would it be possible to add similar functionality to playerstats.php?
User avatar
FTMSupport
Site Admin
Posts: 13193
Joined: Sat Mar 28, 2009 7:25 pm

Re: Team Website API now Available

Post by FTMSupport » Wed Nov 30, 2011 6:03 pm

The lg= parameter was not working quite right. That has now been fixed and can be used on games listings or any of the statistics calls.

We have also now added a "games=" parameter where you can pass a comma separated list of game GUIDs that you want to include in the results. This will work on most of the API calls.
Check out the new iScore Baseball documentation page!
Includes videos and user manual.
http://iscoresports.com/baseball/training.php#docs
70clcl
Posts: 49
Joined: Sun Nov 29, 2009 8:55 am

Re: Team Website API now Available

Post by 70clcl » Wed Nov 30, 2011 6:15 pm

You guys are awesome!!!

I'm sorry to keep adding work for you, but are you planning on officially defining all of the XML attributes? I know in the documentation you state that the attribute names should be "obvious", but just for clarification purposes, are you planning removing any possible ambiguity?

One immediate example I have is as follows. Given the following GAME element, what does calc_ra="99.99" stand for?
I think I have a pretty good feel that the fld_ prefix signifies fielding stats, bat_ prefixes signify batting stats, and calc_ prefixes mean that the value has been somehow calculated on the fly.

<GAME name="11/19/11 ACNF-GNZ at Tapout No Regret " guid="A7A08875-DE89-4D1E-99A8-366FF6EE55C1" calc_err="0" calc_ra="99.99" fld_games="1" bat_games="1" fld_field_errors="0" fld_outs_played="1" fld_started="1" bat_ab="4" bat_pa="4" result="Win" homeScore="0" visitorScore="4" home="Tapout No Regret" visitor="ACNF-GNZ" scheduled="1321752448.0" end="1321757568.0" start="1321752576.0" calc_ko="0" calc_ops="2.000" calc_obp="0.750" bat_bb_risp="0" bat_pa_risp="2" bat_bb="0" bat_ko_swinging="0" fld_pct="1.000" calc_hits="3" calc_avg="0.750" calc_slg="1.250" calc_rpa="0.750" fld_assists="1" fld_putouts="8" bat_fc="0" bat_1b="2" bat_runs="0" bat_roe="0" bat_cs="0" bat_sb="0" bat_ba_risp="1.000" bat_hits_risp="2" bat_rbi="3" calc_sac="0" bat_sac_risp="0" bat_scb="0" bat_ko_looking="0" bat_2b="0" bat_hbp="0" bat_hr="0" bat_3b="1" fld_double_plays="1" calc_pka="0" calc_sba="0" calc_era="0.00" calc_totpitches="0" pit_ip_clean="0.0" other="" pit_games="" pit_scf="" pit_scb="" pit_ci="" override="" fld_passed_balls="0" fld_triple_plays="0" fld_pickoff_success="0" fld_pickoff_failed="0" fld_caught_stealing="0" fld_steals_allowed="0" fld_throw_errors="0" pit_game_score="" pit_inherited_runners="" pit_tough_losses="" pit_quality_starts="" pit_complete_games="" pit_finishes="" pit_starts="" pit_blown_save="" pit_save_op="" pit_holds="" pit_first_balls="" pit_first_strikes="" pit_ground_outs="" pit_air_outs="" pit_game_innings="" pit_save="" pit_loss="" pit_win="" pit_homeruns="" pit_wild_pitch="" pit_balks="" pit_hit_batters="" pit_hits="" pit_int_walks="" pit_walks="" pit_strikeouts="" pit_outs="" pit_er="" pit_runs="" pit_strikes="" pit_balls="" pit_bf="" pit_ip="0.000" bat_ci_risp="0" bat_hbp_risp="0" bat_gitp="0" bat_gidp="0" bat_ci="0" bat_lob="0" bat_sf="0" bat_bunt_singles="0"/>
User avatar
FTMSupport
Site Admin
Posts: 13193
Joined: Sat Mar 28, 2009 7:25 pm

Re: Team Website API now Available

Post by FTMSupport » Wed Nov 30, 2011 6:23 pm

We will not be defining the values in the documentation as new ones will be added in the future, and different sports have different values (football has > 150 stats). It would be a lot of work to keep that document updated when the vast majority of stats can be determined from the legend for the particular sport. For example, the calc_ra stat is the RA stat on a team website. If you hover over the RA heading on the team website, you will see it is a pitching stat that is the Run Average - Average Runs scored per inning pitched.

And yes, the prefixes on the stats for baseball in particular are as you say ... "fld_" is a fielding stat, "bat_xxx" is a batting stat, "pit_xxx" is a pitching stat, and "calc_xxx" is a calculated / derived stat from other data (usually can be calculated from other fields in the result if you want to do it manually, but is common enough that we include in the result for you).
Check out the new iScore Baseball documentation page!
Includes videos and user manual.
http://iscoresports.com/baseball/training.php#docs
Post Reply