cfb.PlayersApi

October 26, 2022 ยท View on GitHub

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

MethodHTTP requestDescription
getPlayerSeasonStatsGET /stats/player/seasonPlayer stats by season
getPlayerUsageGET /player/usagePlayer usage metrics broken down by season
getReturningProductionGET /player/returningTeam returning production metrics
getTransferPortalGET /player/portalTransfer portal by season
playerSearchGET /player/searchSearch for player information

getPlayerSeasonStats

[PlayerSeasonStat] getPlayerSeasonStats(year, opts)

Player stats by season

Season player stats

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.PlayersApi();

var year = 56; // Number | Year filter

var opts = { 
  'team': "team_example", // String | Team filter
  'conference': "conference_example", // String | Conference abbreviation filter
  'startWeek': 56, // Number | Start week filter
  'endWeek': 56, // Number | Start week filter
  'seasonType': "seasonType_example", // String | Season type filter (regular, postseason, or both)
  'category': "category_example" // String | Stat category filter (e.g. passing)
};
apiInstance.getPlayerSeasonStats(year, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
yearNumberYear filter
teamStringTeam filter[optional]
conferenceStringConference abbreviation filter[optional]
startWeekNumberStart week filter[optional]
endWeekNumberStart week filter[optional]
seasonTypeStringSeason type filter (regular, postseason, or both)[optional]
categoryStringStat category filter (e.g. passing)[optional]

Return type

[PlayerSeasonStat]

Authorization

ApiKeyAuth

HTTP request headers

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

getPlayerUsage

[PlayerUsage] getPlayerUsage(year, opts)

Player usage metrics broken down by season

Player usage metrics by 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.PlayersApi();

var year = 2022; // Number | Year filter

var opts = { 
  '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
  'excludeGarbageTime': true // Boolean | Filter to remove garbage time plays from calculations
};
apiInstance.getPlayerUsage(year, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

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

Return type

[PlayerUsage]

Authorization

ApiKeyAuth

HTTP request headers

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

getReturningProduction

[ReturningProduction] getReturningProduction(opts)

Team returning production metrics

Returning production metrics

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.PlayersApi();

var opts = { 
  'year': 56, // Number | Year filter
  'team': "team_example", // String | Team filter
  'conference': "conference_example" // String | Conference abbreviation filter
};
apiInstance.getReturningProduction(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]

Return type

[ReturningProduction]

Authorization

ApiKeyAuth

HTTP request headers

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

getTransferPortal

[PortalPlayer] getTransferPortal(year)

Transfer portal by season

Transfer portal by 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.PlayersApi();

var year = 56; // Number | Year filter

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

Parameters

NameTypeDescriptionNotes
yearNumberYear filter

Return type

[PortalPlayer]

Authorization

ApiKeyAuth

HTTP request headers

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

playerSearch

[PlayerSearchResult] playerSearch(searchTerm, opts)

Search for player information

Search for players

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.PlayersApi();

var searchTerm = "searchTerm_example"; // String | Term to search on

var opts = { 
  'position': "position_example", // String | Position abbreviation filter
  'team': "team_example", // String | Team filter
  'year': 56 // Number | Year filter
};
apiInstance.playerSearch(searchTerm, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
searchTermStringTerm to search on
positionStringPosition abbreviation filter[optional]
teamStringTeam filter[optional]
yearNumberYear filter[optional]

Return type

[PlayerSearchResult]

Authorization

ApiKeyAuth

HTTP request headers

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