README.md

YFAR

A collection of functions to get data from the Yahoo! Fantasy API.

Introduction

The functions in this package can retrieve data from public leagues and the private leagues participated in by the current user logged into Yahoo.

The Yahoo Fantasy API uses Oauth2.0 for authentication. To use the functions in this package you will need a client id and client secret obtained by registering an app with the Yahoo Developer Network.

After creating a token and retrieving some simple input data you can use the functions to return data from games, leagues and teams.

Installation

# install.packages("devtools")
devtools::install_github("https://github.com/macraesdirtysocks/YFAR")

The Basics

Authentication

After creating and registering your app you should receive a client id and client secret.

Pass the client id and secret as arguments to YFAR::y_create_token() which are passed to httr to create an access token.

This token is an argument to all functions in this package.

my_token <- y_create_token(my_key, my_secret, app_name)

Auxiliary data functions

There a few of these but the most noteworthy is y_games(). This function will return a tibble containing information on all your fantasy leagues which can be used as arguments for the more interesting functions.

y_games(my_token)

The Beef

Some functions accept a team_key or league_key. Any function with an key argument as opposed to the more explicit league_key or team_key can accept a varitey of keys.

And much more. See the vignette for more info.

Other notes

If you have suggestions or want to colab shoot me an email.



macraesdirtysocks/YFAR documentation built on March 20, 2022, 2:07 a.m.