CollegeFootballData 5.9.5

dotnet add package CollegeFootballData --version 5.9.5
                    
NuGet\Install-Package CollegeFootballData -Version 5.9.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CollegeFootballData" Version="5.9.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CollegeFootballData" Version="5.9.5" />
                    
Directory.Packages.props
<PackageReference Include="CollegeFootballData" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CollegeFootballData --version 5.9.5
                    
#r "nuget: CollegeFootballData, 5.9.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CollegeFootballData@5.9.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CollegeFootballData&version=5.9.5
                    
Install as a Cake Addin
#tool nuget:?package=CollegeFootballData&version=5.9.5
                    
Install as a Cake Tool

CollegeFootballData.NET

Official .NET client library for the CollegeFootballData.com API. This library provides strongly-typed access to college football data including games, teams, players, statistics, rankings, and more.

Installation

Install the package from NuGet:

dotnet add package CollegeFootballData

Or via Package Manager Console:

Install-Package CollegeFootballData

Or via PackageReference in your .csproj file:

<PackageReference Include="CollegeFootballData" Version="5.8.0" />

Quick Start

Here's a simple example to get games for a specific year:

using CollegeFootballData;
using Microsoft.Kiota.Abstractions.Authentication;
using Microsoft.Kiota.Http.HttpClientLibrary;

// Get API key from environment variable
string apiKey = Environment.GetEnvironmentVariable("COLLEGE_FOOTBALL_API_KEY") 
    ?? throw new InvalidOperationException("API key is required");

// Create authentication provider with Bearer token
var authProvider = new BaseBearerTokenAuthenticationProvider(new StaticAccessTokenProvider(apiKey));

// Create HTTP client and request adapter with authentication
var httpClient = new HttpClient();
var requestAdapter = new HttpClientRequestAdapter(authProvider, httpClient: httpClient);

// Create the API client
var client = new ApiClient(requestAdapter);

// Get games for the 2023 season
var games = await client.Games.GetAsync(requestConfiguration =>
{
    requestConfiguration.QueryParameters.Year = 2023;
});

// Display the first few games
foreach (var game in games.Take(5))
{
    Console.WriteLine($"{game.AwayTeam} @ {game.HomeTeam} - {game.StartDate:yyyy-MM-dd}");
    Console.WriteLine($"Score: {game.AwayPoints} - {game.HomePoints}");
    Console.WriteLine($"Venue: {game.Venue}");
    Console.WriteLine();
}

// Simple access token provider implementation
public class StaticAccessTokenProvider : IAccessTokenProvider
{
    private readonly string _token;

    public StaticAccessTokenProvider(string token)
    {
        _token = token ?? throw new ArgumentNullException(nameof(token));
    }

    public Task<string> GetAuthorizationTokenAsync(Uri uri, Dictionary<string, object>? additionalAuthenticationContext = null, CancellationToken cancellationToken = default)
    {
        return Task.FromResult(_token);
    }

    public AllowedHostsValidator AllowedHostsValidator { get; } = new AllowedHostsValidator();
}

Authentication

Important: API authentication is required for all tiers of the CollegeFootballData.com API.

The API offers different subscription tiers based on monthly call limits:

  • Free tier: 1,000 calls per month (requires API key)
  • Premium tiers: Higher monthly call limits based on Patreon support level

All API calls must include a valid API key as a Bearer token in the Authorization header.

Basic Usage Examples

Get games with filters

// Setup authentication (required for all API calls)
string apiKey = Environment.GetEnvironmentVariable("COLLEGE_FOOTBALL_API_KEY");
var authProvider = new BaseBearerTokenAuthenticationProvider(new StaticAccessTokenProvider(apiKey));
var httpClient = new HttpClient();
var requestAdapter = new HttpClientRequestAdapter(authProvider, httpClient: httpClient);
var client = new ApiClient(requestAdapter);

// Get all games for a specific team in 2023
var teamGames = await client.Games.GetAsync(requestConfiguration =>
{
    requestConfiguration.QueryParameters.Year = 2023;
    requestConfiguration.QueryParameters.Team = "Alabama";
});

// Get games for a specific week
var weekGames = await client.Games.GetAsync(requestConfiguration =>
{
    requestConfiguration.QueryParameters.Year = 2023;
    requestConfiguration.QueryParameters.Week = 1;
});

// Get games between specific teams
var matchup = await client.Games.GetAsync(requestConfiguration =>
{
    requestConfiguration.QueryParameters.Year = 2023;
    requestConfiguration.QueryParameters.Home = "Alabama";
    requestConfiguration.QueryParameters.Away = "Georgia";
});

Get team information

// Get all FBS teams
var teams = await client.Teams.Fbs.GetAsync();

// Get teams from a specific conference
var secTeams = await client.Teams.GetAsync(requestConfiguration =>
{
    requestConfiguration.QueryParameters.Conference = "SEC";
});

Get player statistics

// Get player stats for a season
var playerStats = await client.Stats.Player.Season.GetAsync(requestConfiguration =>
{
    requestConfiguration.QueryParameters.Year = 2023;
    requestConfiguration.QueryParameters.Category = "passing";
});

Error Handling

The library uses standard .NET exception handling. Wrap your API calls in try-catch blocks:

try
{
    var games = await client.Games.GetAsync(requestConfiguration =>
    {
        requestConfiguration.QueryParameters.Year = 2023;
    });
}
catch (HttpRequestException ex)
{
    Console.WriteLine($"HTTP error: {ex.Message}");
}
catch (Exception ex)
{
    Console.WriteLine($"Error: {ex.Message}");
}

Requirements

  • .NET 8.0 or later
  • Microsoft.Kiota packages (automatically included)

Contributing

This library is auto-generated from the CollegeFootballData.com OpenAPI specification. For issues or feature requests, please visit the GitHub repository.

License

This project is licensed under the terms specified in the repository.

Documentation

For detailed documentation on all available endpoints and their parameters, see the following guides:

API Endpoints

  • Games - Historical and live game data
  • Teams - Team information and statistics
  • Players - Player data and statistics
  • Stats - Team and player statistics
  • Rankings - Polls and ranking data
  • Ratings - Team rating systems (ELO, FPI, SP+, SRS)
  • Recruiting - Recruiting rankings and player data
  • Coaches - Coaching staff information
  • Conferences - Conference information and statistics
  • Venues - Stadium and venue information
  • Calendar - Season calendar and week information
  • Records - Team records and historical data
  • Lines - Betting lines and odds
  • Drives - Game drive information
  • Plays - Play-by-play data
  • Live - Live game data
  • Metrics - Advanced team metrics
  • PPA - Predicted Points Added statistics
  • Draft - NFL Draft information
  • Scoreboard - Live scoreboard data
  • Talent - Team talent ratings
  • WEPA - Win Expected Points Added

Guides

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.9.5 16 8/16/2025
5.9.4 93 8/11/2025
5.9.3 92 8/10/2025
5.9.2 164 8/7/2025
5.9.1 88 7/31/2025
5.8.2 89 7/30/2025
5.8.0 87 7/30/2025
5.7.2 91 7/29/2025
5.7.1 90 7/29/2025
5.7.0 63 7/12/2025
5.6.24 59 7/11/2025
5.6.23 59 7/11/2025
5.6.22 62 6/28/2025
5.6.20 139 6/25/2025
5.6.3 137 2/23/2025
5.6.2 110 2/23/2025
1.0.0 107 2/23/2025