Skip to content

CFBD/CFBSharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CFBSharp - the C# library for the College Football Data API

This is an API for accessing all sorts of college football data. Please note that API keys should be supplied with "Bearer " prepended (e.g. "Bearer your_key"). API keys can be acquired from the CollegeFootballData.com website.

This C# SDK is automatically generated by the Swagger Codegen project:

  • API version: 4.6.0
  • SDK version: 4.6.0
  • Build package: io.swagger.codegen.languages.CSharpClientCodegen

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext
  • UWP >=10.0

Dependencies

  • FubarCoder.RestSharp.Portable.Core >=4.0.7
  • FubarCoder.RestSharp.Portable.HttpClient >=4.0.7
  • Newtonsoft.Json >=10.0.3

Installation

Add the package using the dotnet CLI:

dotnet add package CFBSharp

Then use the relevant namespaces:

using CFBSharp.Api;
using CFBSharp.Client;
using CFBSharp.Model;

Getting Started

using System;
using System.Diagnostics;
using CFBSharp.Api;
using CFBSharp.Client;
using CFBSharp.Model;

namespace Example
{
    public class Example
    {
        public void main()
        {

            // Configure API key authorization: ApiKeyAuth
            Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
            Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");

            var apiInstance = new BettingApi();
            var gameId = 56;  // int? | Game id filter (optional) 
            var year = 56;  // int? | Year/season filter for games (optional) 
            var week = 56;  // int? | Week filter (optional) 
            var seasonType = seasonType_example;  // string | Season type filter (regular or postseason) (optional)  (default to regular)
            var team = team_example;  // string | Team (optional) 
            var home = home_example;  // string | Home team filter (optional) 
            var away = away_example;  // string | Away team filter (optional) 
            var conference = conference_example;  // string | Conference abbreviation filter (optional) 

            try
            {
                // Betting lines
                ICollection<GameLines> result = apiInstance.GetLines(gameId, year, week, seasonType, team, home, away, conference);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling BettingApi.GetLines: " + e.Message );
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.collegefootballdata.com

Class Method HTTP request Description
BettingApi GetLines GET /lines Betting lines
CoachesApi GetCoaches GET /coaches Coaching records and history
ConferencesApi GetConferences GET /conferences Conferences
DraftApi GetDraftPicks GET /draft/picks List of NFL Draft picks
DraftApi GetNFLPositions GET /draft/positions List of NFL positions
DraftApi GetNFLTeams GET /draft/teams List of NFL teams
DrivesApi GetDrives GET /drives Drive data and results
GamesApi GetAdvancedBoxScore GET /game/box/advanced Advanced box scores
GamesApi GetCalendar GET /calendar Season calendar
GamesApi GetGameMedia GET /games/media Game media information and schedules
GamesApi GetGameWeather GET /games/weather Game weather information (Patreon only)
GamesApi GetGames GET /games Games and results
GamesApi GetPlayerGameStats GET /games/players Player game stats
GamesApi GetScoreboard GET /scoreboard Live game results (Patreon only)
GamesApi GetTeamGameStats GET /games/teams Team game stats
GamesApi GetTeamRecords GET /records Team records
MetricsApi GetFGEP GET /metrics/fg/ep Field Goal Expected Points
MetricsApi GetGamePPA GET /ppa/games Team Predicated Points Added (PPA/EPA) by game
MetricsApi GetPlayerGamePPA GET /ppa/players/games Player Predicated Points Added (PPA/EPA) broken down by game
MetricsApi GetPlayerSeasonPPA GET /ppa/players/season Player Predicated Points Added (PPA/EPA) broken down by season
MetricsApi GetPredictedPoints GET /ppa/predicted Predicted Points (i.e. Expected Points or EP)
MetricsApi GetPregameWinProbabilities GET /metrics/wp/pregame Pregame win probability data
MetricsApi GetTeamPPA GET /ppa/teams Predicted Points Added (PPA/EPA) data by team
MetricsApi GetWinProbabilityData GET /metrics/wp Win probability chart data
PlayersApi GetPlayerSeasonStats GET /stats/player/season Player stats by season
PlayersApi GetPlayerUsage GET /player/usage Player usage metrics broken down by season
PlayersApi GetReturningProduction GET /player/returning Team returning production metrics
PlayersApi GetTransferPortal GET /player/portal Transfer portal by season
PlayersApi PlayerSearch GET /player/search Search for player information
PlaysApi GetLivePlays GET /live/plays Live metrics and PBP (Patreon only)
PlaysApi GetPlayStatTypes GET /play/stat/types Types of player play stats
PlaysApi GetPlayStats GET /play/stats Play stats by play
PlaysApi GetPlayTypes GET /play/types Play types
PlaysApi GetPlays GET /plays Play by play data
RankingsApi GetRankings GET /rankings Historical polls and rankings
RatingsApi GetConferenceSPRatings GET /ratings/sp/conferences Historical SP+ ratings by conference
RatingsApi GetEloRatings GET /ratings/elo Historical Elo ratings
RatingsApi GetFPIRatings GET /ratings/fpi Historical FPI ratings
RatingsApi GetSPRatings GET /ratings/sp Historical SP+ ratings
RatingsApi GetSRSRatings GET /ratings/srs Historical SRS ratings
RecruitingApi GetRecruitingGroups GET /recruiting/groups Recruit position group ratings
RecruitingApi GetRecruitingPlayers GET /recruiting/players Player recruiting ratings and rankings
RecruitingApi GetRecruitingTeams GET /recruiting/teams Team recruiting rankings and ratings
StatsApi GetAdvancedTeamGameStats GET /stats/game/advanced Advanced team metrics by game
StatsApi GetAdvancedTeamSeasonStats GET /stats/season/advanced Advanced team metrics by season
StatsApi GetStatCategories GET /stats/categories Team stat categories
StatsApi GetTeamSeasonStats GET /stats/season Team statistics by season
TeamsApi GetFbsTeams GET /teams/fbs FBS team list
TeamsApi GetRoster GET /roster Team rosters
TeamsApi GetTalent GET /talent Team talent composite rankings
TeamsApi GetTeamMatchup GET /teams/matchup Team matchup history
TeamsApi GetTeams GET /teams Team information
VenuesApi GetVenues GET /venues Arena and venue information

Documentation for Models

Documentation for Authorization

ApiKeyAuth

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header