views:

738

answers:

4

I think it'd be fun to build a little mini-fantasy baseball game, but after a bit of Googling, I'm getting the impression that there's no easy and reasonably-priced (or free!) way to get that data. Have any of you done something like this? Should I be thinking about screen-scraping?

+2  A: 

I would be wary of screen-scraping. The MLB is notorious for unauthorized use of their stats and players' names. That's why the prices are "out of the park" for you -- those places pay for a licensing fee to use the players names and stats.

Also, I found these:

Daniel A. White
A: 

I've used FanGraphics before to look up live stats... I'd imagine you could scrape the page fairly easily given its layout.

SomeMiscGuy
Scraping is a bad bad idea.
Daniel A. White
true. The OP never said if it had to be realtime(or close) stats. He could always download one of the free sabermetrics databases of player stats from previous years, they are out there.
SomeMiscGuy
indeed at that. when he said fantasy, usually that means near-realtime.
Daniel A. White
+3  A: 

It turns out that MLB.com exposes a TON of data, but I'm not sure yet if it's updated in real-time. And some of the answers here so far are making me afraid of using it. :)

http://gd2.mlb.com/components/

joshjs
+1  A: 

I wrote an library that lets you easily use the MLB real-time data. You can find it at: http://gameday.timothyfisher.com

FYI, while MLB can control access to the gd2.mlb.com server, their attempts to control usage of player names and stats were ruled against by the supreme court in a case a few years ago. Anyone can use stats and player names without obtaining a license from MLB.

Timothy Fisher