Skip to content

Latest commit

 

History

History
399 lines (312 loc) · 13.1 KB

PlayersApi.md

File metadata and controls

399 lines (312 loc) · 13.1 KB

CollegeFootballData.Api.PlayersApi

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

Method HTTP request Description
GetPlayerUsage GET /player/usage
GetReturningProduction GET /player/returning
GetTransferPortal GET /player/portal
SearchPlayers GET /player/search

GetPlayerUsage

List<PlayerUsage> GetPlayerUsage (int year, string? conference = null, string? position = null, string? team = null, int? playerId = null, bool? excludeGarbageTime = null)

Retrieves player usage data for a given season

Example

using System.Collections.Generic;
using System.Diagnostics;
using CollegeFootballData.Api;
using CollegeFootballData.Client;
using CollegeFootballData.Model;

namespace Example
{
    public class GetPlayerUsageExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://apinext.collegefootballdata.com";
            // Configure Bearer token for authorization: apiKey
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PlayersApi(config);
            var year = 56;  // int | Required year filter
            var conference = "conference_example";  // string? | Optional conference abbreviation filter (optional) 
            var position = "position_example";  // string? | Optional position abbreivation filter (optional) 
            var team = "team_example";  // string? | Optional team filter (optional) 
            var playerId = 56;  // int? | Optional player id filter (optional) 
            var excludeGarbageTime = true;  // bool? | Optional exclude garbage time flag, defaults to false (optional) 

            try
            {
                List<PlayerUsage> result = apiInstance.GetPlayerUsage(year, conference, position, team, playerId, excludeGarbageTime);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PlayersApi.GetPlayerUsage: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetPlayerUsageWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    ApiResponse<List<PlayerUsage>> response = apiInstance.GetPlayerUsageWithHttpInfo(year, conference, position, team, playerId, excludeGarbageTime);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling PlayersApi.GetPlayerUsageWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
year int Required year filter
conference string? Optional conference abbreviation filter [optional]
position string? Optional position abbreivation filter [optional]
team string? Optional team filter [optional]
playerId int? Optional player id filter [optional]
excludeGarbageTime bool? Optional exclude garbage time flag, defaults to false [optional]

Return type

List<PlayerUsage>

Authorization

apiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Ok -

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

GetReturningProduction

List<ReturningProduction> GetReturningProduction (int? year = null, string? team = null, string? conference = null)

Retrieves returning production data. Either a year or team filter must be specified.

Example

using System.Collections.Generic;
using System.Diagnostics;
using CollegeFootballData.Api;
using CollegeFootballData.Client;
using CollegeFootballData.Model;

namespace Example
{
    public class GetReturningProductionExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://apinext.collegefootballdata.com";
            // Configure Bearer token for authorization: apiKey
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PlayersApi(config);
            var year = 56;  // int? | Year filter, required if team not specified (optional) 
            var team = "team_example";  // string? | Team filter, required if year not specified (optional) 
            var conference = "conference_example";  // string? | Optional conference filter (optional) 

            try
            {
                List<ReturningProduction> result = apiInstance.GetReturningProduction(year, team, conference);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PlayersApi.GetReturningProduction: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetReturningProductionWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    ApiResponse<List<ReturningProduction>> response = apiInstance.GetReturningProductionWithHttpInfo(year, team, conference);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling PlayersApi.GetReturningProductionWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
year int? Year filter, required if team not specified [optional]
team string? Team filter, required if year not specified [optional]
conference string? Optional conference filter [optional]

Return type

List<ReturningProduction>

Authorization

apiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Ok -

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

GetTransferPortal

List<PlayerTransfer> GetTransferPortal (int year)

Retrieves transfer portal data for a given year

Example

using System.Collections.Generic;
using System.Diagnostics;
using CollegeFootballData.Api;
using CollegeFootballData.Client;
using CollegeFootballData.Model;

namespace Example
{
    public class GetTransferPortalExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://apinext.collegefootballdata.com";
            // Configure Bearer token for authorization: apiKey
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PlayersApi(config);
            var year = 56;  // int | Required year filter

            try
            {
                List<PlayerTransfer> result = apiInstance.GetTransferPortal(year);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PlayersApi.GetTransferPortal: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetTransferPortalWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    ApiResponse<List<PlayerTransfer>> response = apiInstance.GetTransferPortalWithHttpInfo(year);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling PlayersApi.GetTransferPortalWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
year int Required year filter

Return type

List<PlayerTransfer>

Authorization

apiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Ok -

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

SearchPlayers

List<PlayerSearchResult> SearchPlayers (string searchTerm, int? year = null, string? team = null, string? position = null)

Search for players (lists top 100 results)

Example

using System.Collections.Generic;
using System.Diagnostics;
using CollegeFootballData.Api;
using CollegeFootballData.Client;
using CollegeFootballData.Model;

namespace Example
{
    public class SearchPlayersExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://apinext.collegefootballdata.com";
            // Configure Bearer token for authorization: apiKey
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new PlayersApi(config);
            var searchTerm = "searchTerm_example";  // string | Search term for matching player name
            var year = 56;  // int? | Optional year filter (optional) 
            var team = "team_example";  // string? | Optional team filter (optional) 
            var position = "position_example";  // string? | Optional position abbreviation filter (optional) 

            try
            {
                List<PlayerSearchResult> result = apiInstance.SearchPlayers(searchTerm, year, team, position);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PlayersApi.SearchPlayers: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the SearchPlayersWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    ApiResponse<List<PlayerSearchResult>> response = apiInstance.SearchPlayersWithHttpInfo(searchTerm, year, team, position);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling PlayersApi.SearchPlayersWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
searchTerm string Search term for matching player name
year int? Optional year filter [optional]
team string? Optional team filter [optional]
position string? Optional position abbreviation filter [optional]

Return type

List<PlayerSearchResult>

Authorization

apiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Ok -

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