cfb.GamesApi

September 4, 2022 ยท View on GitHub

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

MethodHTTP requestDescription
getAdvancedBoxScoreGET /game/box/advancedAdvanced box scores
getCalendarGET /calendarSeason calendar
getGameMediaGET /games/mediaGame media information and schedules
getGameWeatherGET /games/weatherGame weather information (Patreon only)
getGamesGET /gamesGames and results
getPlayerGameStatsGET /games/playersPlayer game stats
getScoreboardGET /scoreboardLive game results (Patreon only)
getTeamGameStatsGET /games/teamsTeam game stats
getTeamRecordsGET /recordsTeam records

getAdvancedBoxScore

BoxScore getAdvancedBoxScore(gameId)

Advanced box scores

Get advanced box score 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.GamesApi();

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

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

Parameters

NameTypeDescriptionNotes
gameIdNumberGame id parameters

Return type

BoxScore

Authorization

ApiKeyAuth

HTTP request headers

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

getCalendar

[Week] getCalendar(year)

Season calendar

Get calendar of weeks 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.GamesApi();

var year = 56; // Number | Year filter

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

Parameters

NameTypeDescriptionNotes
yearNumberYear filter

Return type

[Week]

Authorization

ApiKeyAuth

HTTP request headers

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

getGameMedia

[GameMedia] getGameMedia(year, opts)

Game media information and schedules

Game media information (TV, radio, etc)

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

var year = 56; // Number | Year filter

var opts = { 
  'week': 56, // Number | Week filter
  'seasonType': "seasonType_example", // String | Season type filter (regular, postseason, or both)
  'team': "team_example", // String | Team filter
  'conference': "conference_example", // String | Conference filter
  'mediaType': "mediaType_example", // String | Media type filter (tv, radio, web, ppv, or mobile)
  'classification': "classification_example" // String | Division classification filter (fbs/fcs/ii/iii)
};
apiInstance.getGameMedia(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]
seasonTypeStringSeason type filter (regular, postseason, or both)[optional]
teamStringTeam filter[optional]
conferenceStringConference filter[optional]
mediaTypeStringMedia type filter (tv, radio, web, ppv, or mobile)[optional]
classificationStringDivision classification filter (fbs/fcs/ii/iii)[optional]

Return type

[GameMedia]

Authorization

ApiKeyAuth

HTTP request headers

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

getGameWeather

[GameWeather] getGameWeather(opts)

Game weather information (Patreon only)

Weather information for the hour of kickoff

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

var opts = { 
  'gameId': 56, // Number | Game id filter (required if no year)
  'year': 56, // Number | Year filter (required if no game id)
  'week': 56, // Number | Week filter
  'seasonType': "seasonType_example", // String | Season type filter (regular, postseason, or both)
  'team': "team_example", // String | Team filter
  'conference': "conference_example", // String | Conference filter
  'classification': "classification_example" // String | Division classification filter (fbs/fcs/ii/iii)
};
apiInstance.getGameWeather(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
gameIdNumberGame id filter (required if no year)[optional]
yearNumberYear filter (required if no game id)[optional]
weekNumberWeek filter[optional]
seasonTypeStringSeason type filter (regular, postseason, or both)[optional]
teamStringTeam filter[optional]
conferenceStringConference filter[optional]
classificationStringDivision classification filter (fbs/fcs/ii/iii)[optional]

Return type

[GameWeather]

Authorization

ApiKeyAuth

HTTP request headers

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

getGames

[Game] getGames(year, opts)

Games and results

Get game results

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

var year = 56; // Number | Year/season filter for games

var opts = { 
  'week': 56, // Number | Week filter
  'seasonType': "regular", // String | Season type filter (regular or postseason)
  'team': "team_example", // String | Team
  'home': "home_example", // String | Home team filter
  'away': "away_example", // String | Away team filter
  'conference': "conference_example", // String | Conference abbreviation filter
  'division': "division_example", // String | Division classification filter (fbs/fcs/ii/iii)
  'id': 56 // Number | id filter for querying a single game
};
apiInstance.getGames(year, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
yearNumberYear/season filter for games
weekNumberWeek filter[optional]
seasonTypeStringSeason type filter (regular or postseason)[optional] [default to regular]
teamStringTeam[optional]
homeStringHome team filter[optional]
awayStringAway team filter[optional]
conferenceStringConference abbreviation filter[optional]
divisionStringDivision classification filter (fbs/fcs/ii/iii)[optional]
idNumberid filter for querying a single game[optional]

Return type

[Game]

Authorization

ApiKeyAuth

HTTP request headers

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

getPlayerGameStats

[PlayerGame] getPlayerGameStats(year, opts)

Player game stats

Player stats broken down 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.GamesApi();

var year = 56; // Number | Year/season filter for games

var opts = { 
  'week': 56, // Number | Week filter
  'seasonType': "regular", // String | Season type filter (regular or postseason)
  'team': "team_example", // String | Team filter
  'conference': "conference_example", // String | Conference abbreviation filter
  'category': "category_example", // String | Category filter (e.g defensive)
  'gameId': 56 // Number | Game id filter
};
apiInstance.getPlayerGameStats(year, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
yearNumberYear/season filter for games
weekNumberWeek filter[optional]
seasonTypeStringSeason type filter (regular or postseason)[optional] [default to regular]
teamStringTeam filter[optional]
conferenceStringConference abbreviation filter[optional]
categoryStringCategory filter (e.g defensive)[optional]
gameIdNumberGame id filter[optional]

Return type

[PlayerGame]

Authorization

ApiKeyAuth

HTTP request headers

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

getScoreboard

[ScoreboardGame] getScoreboard(opts)

Live game results (Patreon only)

Get live game results

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

var opts = { 
  'classification': "classification_example", // String | Classification filter (fbs, fcs, ii, or iii). Defaults to fbs.
  'conference': "conference_example" // String | Conference abbreviation filter.
};
apiInstance.getScoreboard(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
classificationStringClassification filter (fbs, fcs, ii, or iii). Defaults to fbs.[optional]
conferenceStringConference abbreviation filter.[optional]

Return type

[ScoreboardGame]

Authorization

ApiKeyAuth

HTTP request headers

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

getTeamGameStats

[TeamGame] getTeamGameStats(year, opts)

Team game stats

Team stats broken down 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.GamesApi();

var year = 56; // Number | Year/season filter for games

var opts = { 
  'week': 56, // Number | Week filter
  'seasonType': "regular", // String | Season type filter (regular or postseason)
  'team': "team_example", // String | Team filter
  'conference': "conference_example", // String | Conference abbreviation filter
  'gameId': 56, // Number | Game id filter
  'classification': "classification_example" // String | Division classification filter (fbs/fcs/ii/iii)
};
apiInstance.getTeamGameStats(year, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
yearNumberYear/season filter for games
weekNumberWeek filter[optional]
seasonTypeStringSeason type filter (regular or postseason)[optional] [default to regular]
teamStringTeam filter[optional]
conferenceStringConference abbreviation filter[optional]
gameIdNumberGame id filter[optional]
classificationStringDivision classification filter (fbs/fcs/ii/iii)[optional]

Return type

[TeamGame]

Authorization

ApiKeyAuth

HTTP request headers

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

getTeamRecords

[TeamRecord] getTeamRecords(opts)

Team records

Get team records by year

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

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

Return type

[TeamRecord]

Authorization

ApiKeyAuth

HTTP request headers

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