mkreiser / ESPN-Fantasy-Football-API

Connect to ESPN's fantasy football API via this JS API client for web and NodeJS. Available as an npm package.
http://espn-fantasy-football-api.s3-website.us-east-2.amazonaws.com/
GNU Lesser General Public License v3.0
306 stars 76 forks source link

League Status should be available #127

Closed travisryan closed 10 months ago

travisryan commented 5 years ago

I'm going to code something up right now to get league status, but I wanted to put this out here. Every request has a "status" object that provides great detail about the league and the current week, etc. I think that should be available in every request, but should also be it's own request with no scoring period, etc. I'm using it to get the current week status, but there is alot of great info in there that can be passed along easily.

mkreiser commented 4 years ago

@travisryan What data do you want to see from there specifically?

travisryan commented 4 years ago

I'm just returning the entire status, but as stated above, at the moment, I'm only using it to get the current week status, etc.

getStatus({ seasonId }) {
    const routeBase = `${seasonId}/segments/0/leagues/${this.leagueId}`;
    const routeParams = ``;
    const route = `${routeBase}${routeParams}`;

    return axios.get(route, this._buildAxiosConfig()).then((response) => {
      return _.get(response.data, 'status');

    });
  }
mkreiser commented 4 years ago

@travisryan What properties specifically? I don't see a whole lot of useful stuff in there for me, so I'm curious as to what you are using from that object.