HomeroLara / fantasydata-api-csharp

FantasyData API client library wrapper for C#

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fantasydata-api-csharp

FantasyData API client library wrapper for C# (.NET 4.5). For more information on the FantasyData API check the Fantasy Data Developer Portal.

Installation

This library is distributed on Nuget. In order to add to your visual studio project, open the nuget package manager console and use the command:

PM> Install-Package FantasyData.Api.Client

Authentication

You can find your api keys in the Fantasy Data Developer Portal. See Usage for implementation details.

Usage

In this simple example we authenticate the and MLBv3Projections client with its respective key. We then pull projections for 2018-03-29 and just output some information to the console. Be sure to replace <license key> with your API key for this client.

// Connect to client and get data
var client = new MLBv3ProjectionsClient("<license key>");
var projections = client.GetPlayerGameProjectionStatsByDate("2018-03-29").OrderByDescending(p => p.DraftKingsSalary).Take(20).ToList();

// Write data to console
foreach(var projection in projections)
{
    Console.WriteLine($"{projection.PlayerID} - {projection.Name} ({projection.DraftKingsPosition}) DraftKings Salary: {projection.DraftKingsSalary}");
}

Documentation

About

FantasyData API client library wrapper for C#


Languages

Language:C# 100.0%Language:Batchfile 0.0%