ALERT: The Saints have ruled out Alvin Kamara, Chris Olave, and Derek Carr for Monday Night.

PHP Open Source Fantasy Football Class Available

Saturday, Sep 4, 2010 at 12:00 pm ET


For those with the technical know-how, I'm happy to announce that a free open-source package is now available to make it easier and faster to begin using the FantasyFootballNerd.com fantasy football API.



The class is written in PHP 5 and there are samples included. If you haven't registered for a free API Key, you're going to want to do that first. Your key is what authorizes your request and allows FFN to track the request to help prevent people from abusing it.



DownloadThe FFN API will allow you to retrieve:

1. the full NFL schedule

2. the complete list of players in the FFN database

3. details about each player including recent news

4. the award-winning FFN draft rankings

5. current week injuries (in-season only)

6. current week's sit/start rankings including standard & ppr rankings



For example, if you wanted to get the full NFL schedule, you would use the following:

$apiKey = "0000"; //-- Replace the 0000 with your API key

require_once("FFN.class.php");

$ffn = new FFN($apiKey);

$schedule = $ffn->getSchedule();




The $schedule variable will now hold an array of game objects with week number, home team, away team, game date, game time properties.



If you find the class useful, please shoot me an email at [email protected]. If you're truly ambitious and know your way around a language other than PHP, I'd appreciate making other classes available for people to use.



Happy coding!



Joe



Join the Discussion

Nerd CommentedSep 5, 2010 11:00 am

You can also download an excellent fork of the code from GitHub.



http://github.com/philip/FantasyNerdAPI



A big thank you to Philip for cleaning it up and making it more compact and efficient!

Nerd CommentedSep 6, 2010 11:00 am

Here's an outstanding fork from Marc in C#.



http://github.com/marcneuwirth/FantasyFootballNerdAPI.NET



Thank you Marc!


Recent News & Advice

Spooktacular Trivia Giveaway!
Oct 26, 2024 9:10 am by FN Staff
Lineup Analyzer is Back for 2024!
Sep 1, 2024 5:30 pm by FN Staff
Joe's Fantasy Football State of the Union 2024
Aug 25, 2024 1:25 pm by FN Staff
Claim Your Spot - Fantasy Nerds Leagues 2024
Aug 7, 2024 11:33 am by FN Staff
Free 2024 Fantasy Football Draft Kit
Jun 9, 2024 10:09 am by FN Staff
Write Fantasy Football Articles for us!

Searching...