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.

You Aren't a FanGraphs Member
It looks like you aren't yet a FanGraphs Member (or aren't logged in). We aren't mad, just disappointed.
We get it. You want to read this article. But before we let you get back to it, we'd like to point out a few of the good reasons why you should become a Member.
1. Ad Free viewing! We won't bug you with this ad, or any other.
2. Unlimited articles! Non-Members only get to read 10 free articles a month. Members never get cut off.
3. Dark mode and Classic mode!
4. Custom player page dashboards! Choose the player cards you want, in the order you want them.
5. One-click data exports! Export our projections and leaderboards for your personal projects.
6. Remove the photos on the home page! (Honestly, this doesn't sound so great to us, but some people wanted it, and we like to give our Members what they want.)
7. Even more Steamer projections! We have handedness, percentile, and context neutral projections available for Members only.
8. Get FanGraphs Walk-Off, a customized year end review! Find out exactly how you used FanGraphs this year, and how that compares to other Members. Don't be a victim of FOMO.
9. A weekly mailbag column, exclusively for Members.
10. Help support FanGraphs and our entire staff! Our Members provide us with critical resources to improve the site and deliver new features!
We hope you'll consider a Membership today, for yourself or as a gift! And we realize this has been an awfully long sales pitch, so we've also removed all the other ads in this article. We didn't want to overdo it.




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

27 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Dan in Japan
15 years ago

Fascinating, thanks for bringing this to my attention.

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