Skip to content

Latest commit

 

History

History
467 lines (333 loc) · 13.8 KB

MetricsApi.md

File metadata and controls

467 lines (333 loc) · 13.8 KB

cfb.MetricsApi

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

Method HTTP request Description
getFGEP GET /metrics/fg/ep Field Goal Expected Points
getGamePPA GET /ppa/games Team Predicated Points Added (PPA/EPA) by game
getPlayerGamePPA GET /ppa/players/games Player Predicated Points Added (PPA/EPA) broken down by game
getPlayerSeasonPPA GET /ppa/players/season Player Predicated Points Added (PPA/EPA) broken down by season
getPredictedPoints GET /ppa/predicted Predicted Points (i.e. Expected Points or EP)
getPregameWinProbabilities GET /metrics/wp/pregame Pregame win probability data
getTeamPPA GET /ppa/teams Predicted Points Added (PPA/EPA) data by team
getWinProbabilityData GET /metrics/wp Win 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

Name Type Description Notes
year Number Year filter
week Number Week filter [optional]
team String Team filter [optional]
conference String Conference filter [optional]
excludeGarbageTime Boolean Filter to remove garbage time plays from calculations [optional]
seasonType String Season 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

Name Type Description Notes
year Number Year filter [optional]
week Number Week filter [optional]
team String Team filter [optional]
position String Position abbreviation filter [optional]
playerId Number Player id filter [optional]
threshold String Minimum play threshold filter [optional]
excludeGarbageTime Boolean Filter to remove garbage time plays from calculations [optional]
seasonType String Season 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

Name Type Description Notes
year Number Year filter [optional]
team String Team filter [optional]
conference String Conference abbreviation filter [optional]
position String Position abbreviation filter [optional]
playerId Number Player id filter [optional]
threshold String Minimum play threshold filter [optional]
excludeGarbageTime Boolean Filter 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

Name Type Description Notes
down Number Down filter
distance Number Distance 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

Name Type Description Notes
year Number Year filter [optional]
week Number Week filter [optional]
team String Team filter [optional]
seasonType String regular 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

Name Type Description Notes
year Number Year filter (required if team not specified) [optional]
team String Team filter (required if year not specified) [optional]
conference String Conference filter [optional]
excludeGarbageTime Boolean Filter 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

Name Type Description Notes
gameId Number Game id filter

Return type

[PlayWP]

Authorization

ApiKeyAuth

HTTP request headers

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