Skip to content

Latest commit

 

History

History
302 lines (214 loc) · 8.68 KB

PlayersApi.md

File metadata and controls

302 lines (214 loc) · 8.68 KB

cfb.PlayersApi

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

Method HTTP request Description
getPlayerSeasonStats GET /stats/player/season Player stats by season
getPlayerUsage GET /player/usage Player usage metrics broken down by season
getReturningProduction GET /player/returning Team returning production metrics
getTransferPortal GET /player/portal Transfer portal by season
playerSearch GET /player/search Search 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

Name Type Description Notes
year Number Year filter
team String Team filter [optional]
conference String Conference abbreviation filter [optional]
startWeek Number Start week filter [optional]
endWeek Number Start week filter [optional]
seasonType String Season type filter (regular, postseason, or both) [optional]
category String Stat 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

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

Name Type Description Notes
year Number Year filter [optional]
team String Team filter [optional]
conference String Conference 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

Name Type Description Notes
year Number Year 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

Name Type Description Notes
searchTerm String Term to search on
position String Position abbreviation filter [optional]
team String Team filter [optional]
year Number Year filter [optional]

Return type

[PlayerSearchResult]

Authorization

ApiKeyAuth

HTTP request headers

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