

This command will launch a browser that will ask you to authenticate to your app.

You can use the built-in yahoofantasy CLI to obtain an access token and refresh token for your application. get_leagues ( 'mlb', 2020 ) for league in leagues : print ( league. For example, to fetch all of your leagues for a given game/season: from yahoofantasy import Context ctx = Context () leagues = ctx. Once you've logged in, create a context and use that to make requests. This context is where all of your API requests will originate and league information will live. You're going to want to start off by logging in to your Yahoo Developer application, then creating a context. See below for instructions on how to set up your Yahoo Developer application if you don't have one already. The app just needs to have read permissions. You will also need a application registered on the Yahoo Developer Site. It contains some common constructs and helper methods for head-to-head leagues for the NFL 🏈, MLB ⚾, NHL 🏒 and NBA 🏀. This library will work for any Yahoo Fantasy Sports API leagues/teams. This library/SDK makes your life easier if you want to write an app that interfaces with the Yahoo Fantasy Sports API.

The Yahoo Fantasy Sports API is difficult to comprehend, has this strange one-page documentation setup that is hard to navigate, and seems to only want to conform to a small portion of the OAuth spec.
