Skip to content

Latest commit

 

History

History
796 lines (627 loc) · 28.1 KB

MetricsApi.md

File metadata and controls

796 lines (627 loc) · 28.1 KB

CollegeFootballData.Api.MetricsApi

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

Method HTTP request Description
GetFieldGoalExpectedPoints GET /metrics/fg/ep
GetPredictedPoints GET /ppa/predicted
GetPredictedPointsAddedByGame GET /ppa/games
GetPredictedPointsAddedByPlayerGame GET /ppa/players/games
GetPredictedPointsAddedByPlayerSeason GET /ppa/players/season
GetPredictedPointsAddedByTeam GET /ppa/teams
GetPregameWinProbabilities GET /metrics/wp/pregame
GetWinProbability GET /metrics/wp

GetFieldGoalExpectedPoints

List<FieldGoalEP> GetFieldGoalExpectedPoints ()

Queries field goal expected points values

Example

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

namespace Example
{
    public class GetFieldGoalExpectedPointsExample
    {
        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 MetricsApi(config);

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

Using the GetFieldGoalExpectedPointsWithHttpInfo variant

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

try
{
    ApiResponse<List<FieldGoalEP>> response = apiInstance.GetFieldGoalExpectedPointsWithHttpInfo();
    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 MetricsApi.GetFieldGoalExpectedPointsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

This endpoint does not need any parameter.

Return type

List<FieldGoalEP>

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]

GetPredictedPoints

List<PredictedPointsValue> GetPredictedPoints (int down, int distance)

Query Predicted Points values by down and distance

Example

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

namespace Example
{
    public class GetPredictedPointsExample
    {
        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 MetricsApi(config);
            var down = 56;  // int | Down value
            var distance = 56;  // int | Distance value

            try
            {
                List<PredictedPointsValue> result = apiInstance.GetPredictedPoints(down, distance);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MetricsApi.GetPredictedPoints: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetPredictedPointsWithHttpInfo variant

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

try
{
    ApiResponse<List<PredictedPointsValue>> response = apiInstance.GetPredictedPointsWithHttpInfo(down, distance);
    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 MetricsApi.GetPredictedPointsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
down int Down value
distance int Distance value

Return type

List<PredictedPointsValue>

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]

GetPredictedPointsAddedByGame

List<TeamGamePredictedPointsAdded> GetPredictedPointsAddedByGame (int year, int? week = null, SeasonType? seasonType = null, string? team = null, string? conference = null, bool? excludeGarbageTime = null)

Retrieves historical team PPA metrics by game

Example

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

namespace Example
{
    public class GetPredictedPointsAddedByGameExample
    {
        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 MetricsApi(config);
            var year = 56;  // int | Required year filter
            var week = 56;  // int? | Optional week filter (optional) 
            var seasonType = new SeasonType?(); // SeasonType? | Optional season type filter (optional) 
            var team = "team_example";  // string? | Optional team filter (optional) 
            var conference = "conference_example";  // string? | Optional conference abbreviation filter (optional) 
            var excludeGarbageTime = true;  // bool? | Optional flag to exclude garbage time plays (optional) 

            try
            {
                List<TeamGamePredictedPointsAdded> result = apiInstance.GetPredictedPointsAddedByGame(year, week, seasonType, team, conference, excludeGarbageTime);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MetricsApi.GetPredictedPointsAddedByGame: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetPredictedPointsAddedByGameWithHttpInfo variant

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

try
{
    ApiResponse<List<TeamGamePredictedPointsAdded>> response = apiInstance.GetPredictedPointsAddedByGameWithHttpInfo(year, week, seasonType, team, conference, 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 MetricsApi.GetPredictedPointsAddedByGameWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
year int Required year filter
week int? Optional week filter [optional]
seasonType SeasonType? Optional season type filter [optional]
team string? Optional team filter [optional]
conference string? Optional conference abbreviation filter [optional]
excludeGarbageTime bool? Optional flag to exclude garbage time plays [optional]

Return type

List<TeamGamePredictedPointsAdded>

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]

GetPredictedPointsAddedByPlayerGame

List<PlayerGamePredictedPointsAdded> GetPredictedPointsAddedByPlayerGame (int year, int? week = null, SeasonType? seasonType = null, string? team = null, string? position = null, string? playerId = null, double? threshold = null, bool? excludeGarbageTime = null)

Queries player PPA statistics by game

Example

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

namespace Example
{
    public class GetPredictedPointsAddedByPlayerGameExample
    {
        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 MetricsApi(config);
            var year = 56;  // int | Required year filter
            var week = 56;  // int? | Week filter, required if team not specified (optional) 
            var seasonType = new SeasonType?(); // SeasonType? | Optional season type filter (optional) 
            var team = "team_example";  // string? | Team filter, required if week not specified (optional) 
            var position = "position_example";  // string? | Optional player position abbreviation filter (optional) 
            var playerId = "playerId_example";  // string? | Optional player ID filter (optional) 
            var threshold = 1.2D;  // double? | Threshold value for minimum number of plays (optional) 
            var excludeGarbageTime = true;  // bool? | Optional flag to exclude garbage time plays (optional) 

            try
            {
                List<PlayerGamePredictedPointsAdded> result = apiInstance.GetPredictedPointsAddedByPlayerGame(year, week, seasonType, team, position, playerId, threshold, excludeGarbageTime);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MetricsApi.GetPredictedPointsAddedByPlayerGame: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetPredictedPointsAddedByPlayerGameWithHttpInfo variant

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

try
{
    ApiResponse<List<PlayerGamePredictedPointsAdded>> response = apiInstance.GetPredictedPointsAddedByPlayerGameWithHttpInfo(year, week, seasonType, team, position, playerId, threshold, 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 MetricsApi.GetPredictedPointsAddedByPlayerGameWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
year int Required year filter
week int? Week filter, required if team not specified [optional]
seasonType SeasonType? Optional season type filter [optional]
team string? Team filter, required if week not specified [optional]
position string? Optional player position abbreviation filter [optional]
playerId string? Optional player ID filter [optional]
threshold double? Threshold value for minimum number of plays [optional]
excludeGarbageTime bool? Optional flag to exclude garbage time plays [optional]

Return type

List<PlayerGamePredictedPointsAdded>

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]

GetPredictedPointsAddedByPlayerSeason

List<PlayerSeasonPredictedPointsAdded> GetPredictedPointsAddedByPlayerSeason (int? year = null, string? conference = null, string? team = null, string? position = null, string? playerId = null, double? threshold = null, bool? excludeGarbageTime = null)

Queries player PPA statistics by season

Example

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

namespace Example
{
    public class GetPredictedPointsAddedByPlayerSeasonExample
    {
        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 MetricsApi(config);
            var year = 56;  // int? | Year filter, required if playerId not specified (optional) 
            var conference = "conference_example";  // string? | Optional conference abbreviation filter (optional) 
            var team = "team_example";  // string? | Optional team filter (optional) 
            var position = "position_example";  // string? | Optional position abbreviation filter (optional) 
            var playerId = "playerId_example";  // string? | Player ID filter, required if year not specified (optional) 
            var threshold = 1.2D;  // double? | Threshold value for minimum number of plays (optional) 
            var excludeGarbageTime = true;  // bool? | Optional flag to exclude garbage time plays (optional) 

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

Using the GetPredictedPointsAddedByPlayerSeasonWithHttpInfo variant

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

try
{
    ApiResponse<List<PlayerSeasonPredictedPointsAdded>> response = apiInstance.GetPredictedPointsAddedByPlayerSeasonWithHttpInfo(year, conference, team, position, playerId, threshold, 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 MetricsApi.GetPredictedPointsAddedByPlayerSeasonWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
year int? Year filter, required if playerId not specified [optional]
conference string? Optional conference abbreviation filter [optional]
team string? Optional team filter [optional]
position string? Optional position abbreviation filter [optional]
playerId string? Player ID filter, required if year not specified [optional]
threshold double? Threshold value for minimum number of plays [optional]
excludeGarbageTime bool? Optional flag to exclude garbage time plays [optional]

Return type

List<PlayerSeasonPredictedPointsAdded>

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]

GetPredictedPointsAddedByTeam

List<TeamSeasonPredictedPointsAdded> GetPredictedPointsAddedByTeam (int? year = null, string? team = null, string? conference = null, bool? excludeGarbageTime = null)

Retrieves historical team PPA metrics by season

Example

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

namespace Example
{
    public class GetPredictedPointsAddedByTeamExample
    {
        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 MetricsApi(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? | Conference abbreviation filter (optional) 
            var excludeGarbageTime = true;  // bool? | Exclude garbage time plays (optional) 

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

Using the GetPredictedPointsAddedByTeamWithHttpInfo variant

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

try
{
    ApiResponse<List<TeamSeasonPredictedPointsAdded>> response = apiInstance.GetPredictedPointsAddedByTeamWithHttpInfo(year, team, conference, 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 MetricsApi.GetPredictedPointsAddedByTeamWithHttpInfo: " + 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? Conference abbreviation filter [optional]
excludeGarbageTime bool? Exclude garbage time plays [optional]

Return type

List<TeamSeasonPredictedPointsAdded>

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]

GetPregameWinProbabilities

List<PregameWinProbability> GetPregameWinProbabilities (int? year = null, int? week = null, SeasonType? seasonType = null, string? team = null)

Queries pregame win probabilities

Example

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

namespace Example
{
    public class GetPregameWinProbabilitiesExample
    {
        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 MetricsApi(config);
            var year = 56;  // int? | Optional year filter (optional) 
            var week = 56;  // int? | Optional week filter (optional) 
            var seasonType = new SeasonType?(); // SeasonType? | Optional season type filter (optional) 
            var team = "team_example";  // string? | Optional team filter (optional) 

            try
            {
                List<PregameWinProbability> result = apiInstance.GetPregameWinProbabilities(year, week, seasonType, team);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MetricsApi.GetPregameWinProbabilities: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetPregameWinProbabilitiesWithHttpInfo variant

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

try
{
    ApiResponse<List<PregameWinProbability>> response = apiInstance.GetPregameWinProbabilitiesWithHttpInfo(year, week, seasonType, team);
    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 MetricsApi.GetPregameWinProbabilitiesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
year int? Optional year filter [optional]
week int? Optional week filter [optional]
seasonType SeasonType? Optional season type filter [optional]
team string? Optional team filter [optional]

Return type

List<PregameWinProbability>

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]

GetWinProbability

List<PlayWinProbability> GetWinProbability (int gameId)

Query play win probabilities by game

Example

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

namespace Example
{
    public class GetWinProbabilityExample
    {
        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 MetricsApi(config);
            var gameId = 56;  // int | Required game ID filter

            try
            {
                List<PlayWinProbability> result = apiInstance.GetWinProbability(gameId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MetricsApi.GetWinProbability: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetWinProbabilityWithHttpInfo variant

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

try
{
    ApiResponse<List<PlayWinProbability>> response = apiInstance.GetWinProbabilityWithHttpInfo(gameId);
    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 MetricsApi.GetWinProbabilityWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
gameId int Required game ID filter

Return type

List<PlayWinProbability>

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]