The Yahoo Fantasy Baseball API

Today, I’m going to take a look at Yahoo’s Fantasy Sports API. If any of the details are unclear, just leave a comment and we’ll clear ’em up.

The Fantasy Sports API, announced on June 2, 2010, appears to be the only published and freely available API of its kind on the web. Currently baseball and football are included in the API, with basketball and hockey coming later in the year. From here we’ll take it FAQ-style.

What is an API?
In a general sense, an API (Application Programming Interface) is a piece of software that exposes functionality for other software to leverage or integrate. More specific to the web realm, APIs allow sites and applications to retrieve and post data from external services. APIs are the glue that holds Web 2.0 together: mashup sites that incorporate a live Twitter feed or Google Map, buttons that let you “like” a blog post on Facebook, and similar things are all taking advantage of APIs.

So what does the Yahoo Fantasy Sports API do then?
In a nutshell, this API fulfills requests for information with structured data responses. So, if your app wants to know what Barry Zito did in a specific game, or the draft results of a fantasy team, it makes a call out to Yahoo’s API, and gets the requested data back in either an xml or json response. The data in either response format is the same and structured the same way, but have different uses. Xml is a markup language and superset of html, while json is an object notation designed for use with Javascript, but that can be decoded by any popular programming language. The Fantasy Sports API is primarily a read-only tool at this point, but there is an API call post transactions to a team as well.

What data is available?
I’ll admit I haven’t fully sunk my teeth into this yet, but from reading the documentation, it’s mostly metadata associated with running fantasy leagues: draft results, team rosters, ownership status, etc. Individual player stats are available, but which ones specifically isn’t included in the documentation.

Can I set it in action?
Given that the API was only released less than a month ago, there don’t seem to be many live examples yet. The only one I’ve found of a site or app using the Yahoo Fantasy Baseball API is the Pickemfirst app, which I haven’t tried since I am not participating in any fantasy leagues this year. On top of that, usage of this API is limited to non-commercial tools and applications, which may act as a deterrent to potential developers. The hobbyist community is capable of producing great things, though, so it’ll be interesting to see what emerges from the release of this API.



Print This Post



Patrick Newman is a veteran enthusiast of Japanese baseball who happens to write about it at npbtracker.com, and on Twitter @npbtracker.


Sort by:   newest | oldest | most voted
Dan in Japan
Guest
Dan in Japan

Fascinating, thanks for bringing this to my attention.

Hopefully if there are other live examples out there, commenters will link them…

wpDiscuz