Skip to content

Latest commit

 

History

History
548 lines (394 loc) · 16.1 KB

GamesApi.md

File metadata and controls

548 lines (394 loc) · 16.1 KB

cfb.GamesApi

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

Method HTTP request Description
getAdvancedBoxScore GET /game/box/advanced Advanced box scores
getCalendar GET /calendar Season calendar
getGameMedia GET /games/media Game media information and schedules
getGameWeather GET /games/weather Game weather information (Patreon only)
getGames GET /games Games and results
getPlayerGameStats GET /games/players Player game stats
getScoreboard GET /scoreboard Live game results (Patreon only)
getTeamGameStats GET /games/teams Team game stats
getTeamRecords GET /records Team 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

Name Type Description Notes
gameId Number Game 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

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

Name Type Description Notes
year Number Year filter
week Number Week filter [optional]
seasonType String Season type filter (regular, postseason, or both) [optional]
team String Team filter [optional]
conference String Conference filter [optional]
mediaType String Media type filter (tv, radio, web, ppv, or mobile) [optional]
classification String Division 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

Name Type Description Notes
gameId Number Game id filter (required if no year) [optional]
year Number Year filter (required if no game id) [optional]
week Number Week filter [optional]
seasonType String Season type filter (regular, postseason, or both) [optional]
team String Team filter [optional]
conference String Conference filter [optional]
classification String Division 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

Name Type Description Notes
year Number Year/season filter for games
week Number Week filter [optional]
seasonType String Season type filter (regular or postseason) [optional] [default to regular]
team String Team [optional]
home String Home team filter [optional]
away String Away team filter [optional]
conference String Conference abbreviation filter [optional]
division String Division classification filter (fbs/fcs/ii/iii) [optional]
id Number id 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

Name Type Description Notes
year Number Year/season filter for games
week Number Week filter [optional]
seasonType String Season type filter (regular or postseason) [optional] [default to regular]
team String Team filter [optional]
conference String Conference abbreviation filter [optional]
category String Category filter (e.g defensive) [optional]
gameId Number Game 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

Name Type Description Notes
classification String Classification filter (fbs, fcs, ii, or iii). Defaults to fbs. [optional]
conference String Conference 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

Name Type Description Notes
year Number Year/season filter for games
week Number Week filter [optional]
seasonType String Season type filter (regular or postseason) [optional] [default to regular]
team String Team filter [optional]
conference String Conference abbreviation filter [optional]
gameId Number Game id filter [optional]
classification String Division 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

Name Type Description Notes
year Number Year filter [optional]
team String Team filter [optional]
conference String Conference filter [optional]

Return type

[TeamRecord]

Authorization

ApiKeyAuth

HTTP request headers

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