Skip to content

Latest commit

 

History

History
375 lines (291 loc) · 12.5 KB

PlayersApi.md

File metadata and controls

375 lines (291 loc) · 12.5 KB

CFBSharp.Api.PlayersApi

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

Method HTTP request Description
GetPlayerSeasonStats GET /stats/player/season Player stats by season
GetPlayerUsage GET /player/usage Player usage metrics broken down by season
GetReturningProduction GET /player/returning Team returning production metrics
GetTransferPortal GET /player/portal Transfer portal by season
PlayerSearch GET /player/search Search for player information

GetPlayerSeasonStats

ICollection GetPlayerSeasonStats (int? year, string team = null, string conference = null, int? startWeek = null, int? endWeek = null, string seasonType = null, string category = null)

Player stats by season

Season player stats

Example

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

namespace Example
{
    public class GetPlayerSeasonStatsExample
    {
        public void main()
        {
            // Configure API key authorization: ApiKeyAuth
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new PlayersApi();
            var year = 56;  // int? | Year filter
            var team = team_example;  // string | Team filter (optional) 
            var conference = conference_example;  // string | Conference abbreviation filter (optional) 
            var startWeek = 56;  // int? | Start week filter (optional) 
            var endWeek = 56;  // int? | Start week filter (optional) 
            var seasonType = seasonType_example;  // string | Season type filter (regular, postseason, or both) (optional) 
            var category = category_example;  // string | Stat category filter (e.g. passing) (optional) 

            try
            {
                // Player stats by season
                ICollection<PlayerSeasonStat> result = apiInstance.GetPlayerSeasonStats(year, team, conference, startWeek, endWeek, seasonType, category);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PlayersApi.GetPlayerSeasonStats: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
year int? Year filter
team string Team filter [optional]
conference string Conference abbreviation filter [optional]
startWeek int? Start week filter [optional]
endWeek int? Start week filter [optional]
seasonType string Season type filter (regular, postseason, or both) [optional]
category string Stat category filter (e.g. passing) [optional]

Return type

ICollection

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetPlayerUsage

ICollection GetPlayerUsage (int? year, string team = null, string conference = null, string position = null, int? playerId = null, bool? excludeGarbageTime = null)

Player usage metrics broken down by season

Player usage metrics by season

Example

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

namespace Example
{
    public class GetPlayerUsageExample
    {
        public void main()
        {
            // Configure API key authorization: ApiKeyAuth
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new PlayersApi();
            var year = 56;  // int? | Year filter (default to 2022)
            var team = team_example;  // string | Team filter (optional) 
            var conference = conference_example;  // string | Conference abbreviation filter (optional) 
            var position = position_example;  // string | Position abbreviation filter (optional) 
            var playerId = 56;  // int? | Player id filter (optional) 
            var excludeGarbageTime = true;  // bool? | Filter to remove garbage time plays from calculations (optional) 

            try
            {
                // Player usage metrics broken down by season
                ICollection<PlayerUsage> result = apiInstance.GetPlayerUsage(year, team, conference, position, playerId, excludeGarbageTime);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PlayersApi.GetPlayerUsage: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
year int? Year filter [default to 2022]
team string Team filter [optional]
conference string Conference abbreviation filter [optional]
position string Position abbreviation filter [optional]
playerId int? Player id filter [optional]
excludeGarbageTime bool? Filter to remove garbage time plays from calculations [optional]

Return type

ICollection

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetReturningProduction

ICollection GetReturningProduction (int? year = null, string team = null, string conference = null)

Team returning production metrics

Returning production metrics

Example

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

namespace Example
{
    public class GetReturningProductionExample
    {
        public void main()
        {
            // Configure API key authorization: ApiKeyAuth
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new PlayersApi();
            var year = 56;  // int? | Year filter (optional) 
            var team = team_example;  // string | Team filter (optional) 
            var conference = conference_example;  // string | Conference abbreviation filter (optional) 

            try
            {
                // Team returning production metrics
                ICollection<ReturningProduction> result = apiInstance.GetReturningProduction(year, team, conference);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PlayersApi.GetReturningProduction: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
year int? Year filter [optional]
team string Team filter [optional]
conference string Conference abbreviation filter [optional]

Return type

ICollection

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetTransferPortal

ICollection GetTransferPortal (int? year)

Transfer portal by season

Transfer portal by season

Example

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

namespace Example
{
    public class GetTransferPortalExample
    {
        public void main()
        {
            // Configure API key authorization: ApiKeyAuth
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new PlayersApi();
            var year = 56;  // int? | Year filter

            try
            {
                // Transfer portal by season
                ICollection<PortalPlayer> result = apiInstance.GetTransferPortal(year);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PlayersApi.GetTransferPortal: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
year int? Year filter

Return type

ICollection

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PlayerSearch

ICollection PlayerSearch (string searchTerm, string position = null, string team = null, int? year = null)

Search for player information

Search for players

Example

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

namespace Example
{
    public class PlayerSearchExample
    {
        public void main()
        {
            // Configure API key authorization: ApiKeyAuth
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new PlayersApi();
            var searchTerm = searchTerm_example;  // string | Term to search on
            var position = position_example;  // string | Position abbreviation filter (optional) 
            var team = team_example;  // string | Team filter (optional) 
            var year = 56;  // int? | Year filter (optional) 

            try
            {
                // Search for player information
                ICollection<PlayerSearchResult> result = apiInstance.PlayerSearch(searchTerm, position, team, year);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PlayersApi.PlayerSearch: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
searchTerm string Term to search on
position string Position abbreviation filter [optional]
team string Team filter [optional]
year int? Year filter [optional]

Return type

ICollection

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]