cfb.MetricsApi

December 9, 2023 ยท View on GitHub

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

MethodHTTP requestDescription
getFGEPGET /metrics/fg/epField Goal Expected Points
getGamePPAGET /ppa/gamesTeam Predicated Points Added (PPA/EPA) by game
getPlayerGamePPAGET /ppa/players/gamesPlayer Predicated Points Added (PPA/EPA) broken down by game
getPlayerSeasonPPAGET /ppa/players/seasonPlayer Predicated Points Added (PPA/EPA) broken down by season
getPredictedPointsGET /ppa/predictedPredicted Points (i.e. Expected Points or EP)
getPregameWinProbabilitiesGET /metrics/wp/pregamePregame win probability data
getTeamPPAGET /ppa/teamsPredicted Points Added (PPA/EPA) data by team
getWinProbabilityDataGET /metrics/wpWin probability chart data

getFGEP

[FieldGoalExpectedPoints] getFGEP()

Field Goal Expected Points

Field Goal Expected Poitns

Example

var cfb = require('cfb.js');
var defaultClient = cfb.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

var apiInstance = new cfb.MetricsApi();
apiInstance.getFGEP().then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

[FieldGoalExpectedPoints]

Authorization

ApiKeyAuth

HTTP request headers

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

getGamePPA

[GamePPA] getGamePPA(year, opts)

Team Predicated Points Added (PPA/EPA) by game

Predicted Points Added (PPA) by game

Example

var cfb = require('cfb.js');
var defaultClient = cfb.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

var apiInstance = new cfb.MetricsApi();

var year = 56; // Number | Year filter

var opts = { 
  'week': 56, // Number | Week filter
  'team': "team_example", // String | Team filter
  'conference': "conference_example", // String | Conference filter
  'excludeGarbageTime': true, // Boolean | Filter to remove garbage time plays from calculations
  'seasonType': "regular" // String | Season type filter (regular or postseason)
};
apiInstance.getGamePPA(year, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
yearNumberYear filter
weekNumberWeek filter[optional]
teamStringTeam filter[optional]
conferenceStringConference filter[optional]
excludeGarbageTimeBooleanFilter to remove garbage time plays from calculations[optional]
seasonTypeStringSeason type filter (regular or postseason)[optional] [default to regular]

Return type

[GamePPA]

Authorization

ApiKeyAuth

HTTP request headers

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

getPlayerGamePPA

[PlayerGamePPA] getPlayerGamePPA(opts)

Player Predicated Points Added (PPA/EPA) broken down by game

Predicted Points Added (PPA) by player game

Example

var cfb = require('cfb.js');
var defaultClient = cfb.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

var apiInstance = new cfb.MetricsApi();

var opts = { 
  'year': 56, // Number | Year filter
  'week': 56, // Number | Week filter
  'team': "team_example", // String | Team filter
  'position': "position_example", // String | Position abbreviation filter
  'playerId': 56, // Number | Player id filter
  'threshold': "threshold_example", // String | Minimum play threshold filter
  'excludeGarbageTime': true, // Boolean | Filter to remove garbage time plays from calculations
  'seasonType': "regular" // String | Season type filter (regular or postseason)
};
apiInstance.getPlayerGamePPA(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
yearNumberYear filter[optional]
weekNumberWeek filter[optional]
teamStringTeam filter[optional]
positionStringPosition abbreviation filter[optional]
playerIdNumberPlayer id filter[optional]
thresholdStringMinimum play threshold filter[optional]
excludeGarbageTimeBooleanFilter to remove garbage time plays from calculations[optional]
seasonTypeStringSeason type filter (regular or postseason)[optional] [default to regular]

Return type

[PlayerGamePPA]

Authorization

ApiKeyAuth

HTTP request headers

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

getPlayerSeasonPPA

[PlayerSeasonPPA] getPlayerSeasonPPA(opts)

Player Predicated Points Added (PPA/EPA) broken down by season

Predicted Points Added (PPA) by player season

Example

var cfb = require('cfb.js');
var defaultClient = cfb.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

var apiInstance = new cfb.MetricsApi();

var opts = { 
  'year': 56, // Number | Year filter
  'team': "team_example", // String | Team filter
  'conference': "conference_example", // String | Conference abbreviation filter
  'position': "position_example", // String | Position abbreviation filter
  'playerId': 56, // Number | Player id filter
  'threshold': "threshold_example", // String | Minimum play threshold filter
  'excludeGarbageTime': true // Boolean | Filter to remove garbage time plays from calculations
};
apiInstance.getPlayerSeasonPPA(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
yearNumberYear filter[optional]
teamStringTeam filter[optional]
conferenceStringConference abbreviation filter[optional]
positionStringPosition abbreviation filter[optional]
playerIdNumberPlayer id filter[optional]
thresholdStringMinimum play threshold filter[optional]
excludeGarbageTimeBooleanFilter to remove garbage time plays from calculations[optional]

Return type

[PlayerSeasonPPA]

Authorization

ApiKeyAuth

HTTP request headers

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

getPredictedPoints

[PredictedPoints] getPredictedPoints(down, distance)

Predicted Points (i.e. Expected Points or EP)

Predicted Points

Example

var cfb = require('cfb.js');
var defaultClient = cfb.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

var apiInstance = new cfb.MetricsApi();

var down = 56; // Number | Down filter

var distance = 56; // Number | Distance filter

apiInstance.getPredictedPoints(down, distance).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
downNumberDown filter
distanceNumberDistance filter

Return type

[PredictedPoints]

Authorization

ApiKeyAuth

HTTP request headers

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

getPregameWinProbabilities

[PregameWP] getPregameWinProbabilities(opts)

Pregame win probability data

Pregame win probabilities

Example

var cfb = require('cfb.js');
var defaultClient = cfb.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

var apiInstance = new cfb.MetricsApi();

var opts = { 
  'year': 56, // Number | Year filter
  'week': 56, // Number | Week filter
  'team': "team_example", // String | Team filter
  'seasonType': "seasonType_example" // String | regular or postseason
};
apiInstance.getPregameWinProbabilities(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
yearNumberYear filter[optional]
weekNumberWeek filter[optional]
teamStringTeam filter[optional]
seasonTypeStringregular or postseason[optional]

Return type

[PregameWP]

Authorization

ApiKeyAuth

HTTP request headers

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

getTeamPPA

[TeamPPA] getTeamPPA(opts)

Predicted Points Added (PPA/EPA) data by team

Predicted Points Added (PPA)

Example

var cfb = require('cfb.js');
var defaultClient = cfb.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

var apiInstance = new cfb.MetricsApi();

var opts = { 
  'year': 56, // Number | Year filter (required if team not specified)
  'team': "team_example", // String | Team filter (required if year not specified)
  'conference': "conference_example", // String | Conference filter
  'excludeGarbageTime': true // Boolean | Filter to remove garbage time plays from calculations
};
apiInstance.getTeamPPA(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
yearNumberYear filter (required if team not specified)[optional]
teamStringTeam filter (required if year not specified)[optional]
conferenceStringConference filter[optional]
excludeGarbageTimeBooleanFilter to remove garbage time plays from calculations[optional]

Return type

[TeamPPA]

Authorization

ApiKeyAuth

HTTP request headers

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

getWinProbabilityData

[PlayWP] getWinProbabilityData(gameId)

Win probability chart data

Win probability data

Example

var cfb = require('cfb.js');
var defaultClient = cfb.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

var apiInstance = new cfb.MetricsApi();

var gameId = 56; // Number | Game id filter

apiInstance.getWinProbabilityData(gameId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
gameIdNumberGame id filter

Return type

[PlayWP]

Authorization

ApiKeyAuth

HTTP request headers

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