Node.js and express wrapper for Yahoo Fantasy API

node Aug 4, 2014

With the NFL season just 31 days away (8/3/2014), I'm proud to release a Node.js wrapper for the Yahoo Fantasy API! It's not a whole lot yet, and basically just helps with the setup and not with individual API calls, but it's still one of the only one's around, and should greatly ease the pain of working with the API.

You can check out the README on the repository for a more in depth look, but the basic idea is you setup an express app, setup some options, and hook into a few routes to setup and call the API.

var FantasySports = require('FantasySports');
    "accessTokenUrl": "",
    "requestTokenUrl": "",
    "oauthKey": process.env.OAUTHKEY,
    "oauthSecret": process.env.OAUTHSECRET,
    "version": "1.0",
    "callback": "",
    "encryption": "HMAC-SHA1"

// app.get("/auth/oauth")
exports.oauth = function(req, res) {
    FantasySports.startAuth(req, res);

// app.get("/auth/oauth/callback")
exports.authorize = function(req, res) {
    FantasySports.endAuth(req, res);

exports.myTeams = function(req, res) {
        .request(req, res)
        .done(function(data) {
            // Do stuff with data
            res.json(/* your response */);

Hope it'll ease your pain in setting up your own Fantasy App for your league!

As usual per OSS, feel free to have at it and let me know if you have questions or any feature ideas.