4.3.2 • Published 2 years ago

cfb.js v4.3.2

Weekly downloads
55
License
MIT
Repository
github
Last release
2 years ago

cfb.js

cfb - JavaScript client for cfb.js This is an API for accessing all sorts of college football data. Please note that API keys should be supplied with \"Bearer \" prepended (e.g. \"Bearer your_key\"). API keys can be acquired from the CollegeFootballData.com website. This SDK is automatically generated by the Swagger Codegen project:

  • API version: 4.3.2
  • Package version: 4.3.2
  • Build package: io.swagger.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install cfb.js --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually use this library):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var cfb = require('cfb.js');

var defaultClient = cfb.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = "Bearer YOUR_API_KEY";

var api = new cfb.BettingApi()

var opts = { 
  'gameId': 56, // {Number} Game id filter
  'year': 56, // {Number} Year/season filter for games
  '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
};
api.getLines(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
cfb.BettingApigetLinesGET /linesBetting lines
cfb.CoachesApigetCoachesGET /coachesCoaching records and history
cfb.ConferencesApigetConferencesGET /conferencesConferences
cfb.DraftApigetDraftPicksGET /draft/picksList of NFL Draft picks
cfb.DraftApigetNFLPositionsGET /draft/positionsList of NFL positions
cfb.DraftApigetNFLTeamsGET /draft/teamsList of NFL teams
cfb.DrivesApigetDrivesGET /drivesDrive data and results
cfb.GamesApigetAdvancedBoxScoreGET /game/box/advancedAdvanced box scores
cfb.GamesApigetCalendarGET /calendarSeason calendar
cfb.GamesApigetGameMediaGET /games/mediaGame media information and schedules
cfb.GamesApigetGameWeatherGET /games/weatherGame weather information (Patreon only)
cfb.GamesApigetGamesGET /gamesGames and results
cfb.GamesApigetPlayerGameStatsGET /games/playersPlayer game stats
cfb.GamesApigetScoreboardGET /scoreboardLive game results (Patreon only)
cfb.GamesApigetTeamGameStatsGET /games/teamsTeam game stats
cfb.GamesApigetTeamRecordsGET /recordsTeam records
cfb.MetricsApigetGamePPAGET /ppa/gamesTeam Predicated Points Added (PPA/EPA) by game
cfb.MetricsApigetPlayerGamePPAGET /ppa/players/gamesPlayer Predicated Points Added (PPA/EPA) broken down by game
cfb.MetricsApigetPlayerSeasonPPAGET /ppa/players/seasonPlayer Predicated Points Added (PPA/EPA) broken down by season
cfb.MetricsApigetPredictedPointsGET /ppa/predictedPredicted Points (i.e. Expected Points or EP)
cfb.MetricsApigetPregameWinProbabilitiesGET /metrics/wp/pregamePregame win probability data
cfb.MetricsApigetTeamPPAGET /ppa/teamsPredicted Points Added (PPA/EPA) data by team
cfb.MetricsApigetWinProbabilityDataGET /metrics/wpWin probability chart data
cfb.PlayersApigetPlayerSeasonStatsGET /stats/player/seasonPlayer stats by season
cfb.PlayersApigetPlayerUsageGET /player/usagePlayer usage metrics broken down by season
cfb.PlayersApigetReturningProductionGET /player/returningTeam returning production metrics
cfb.PlayersApigetTransferPortalGET /player/portalTransfer portal by season
cfb.PlayersApiplayerSearchGET /player/searchSearch for player information
cfb.PlaysApigetLivePlaysGET /live/playsLive metrics and PBP (Patreon only)
cfb.PlaysApigetPlayStatTypesGET /play/stat/typesTypes of player play stats
cfb.PlaysApigetPlayStatsGET /play/statsPlay stats by play
cfb.PlaysApigetPlayTypesGET /play/typesPlay types
cfb.PlaysApigetPlaysGET /playsPlay by play data
cfb.RankingsApigetRankingsGET /rankingsHistorical polls and rankings
cfb.RatingsApigetConferenceSPRatingsGET /ratings/sp/conferencesHistorical SP+ ratings by conference
cfb.RatingsApigetEloRatingsGET /ratings/eloHistorical Elo ratings
cfb.RatingsApigetSPRatingsGET /ratings/spHistorical SP+ ratings
cfb.RatingsApigetSRSRatingsGET /ratings/srsHistorical SRS ratings
cfb.RecruitingApigetRecruitingGroupsGET /recruiting/groupsRecruit position group ratings
cfb.RecruitingApigetRecruitingPlayersGET /recruiting/playersPlayer recruiting ratings and rankings
cfb.RecruitingApigetRecruitingTeamsGET /recruiting/teamsTeam recruiting rankings and ratings
cfb.StatsApigetAdvancedTeamGameStatsGET /stats/game/advancedAdvanced team metrics by game
cfb.StatsApigetAdvancedTeamSeasonStatsGET /stats/season/advancedAdvanced team metrics by season
cfb.StatsApigetStatCategoriesGET /stats/categoriesTeam stat categories
cfb.StatsApigetTeamSeasonStatsGET /stats/seasonTeam statistics by season
cfb.TeamsApigetFbsTeamsGET /teams/fbsFBS team list
cfb.TeamsApigetRosterGET /rosterTeam rosters
cfb.TeamsApigetTalentGET /talentTeam talent composite rankings
cfb.TeamsApigetTeamMatchupGET /teams/matchupTeam matchup history
cfb.TeamsApigetTeamsGET /teamsTeam information
cfb.VenuesApigetVenuesGET /venuesArena and venue information

Documentation for Models

Documentation for Authorization

ApiKeyAuth

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header
4.3.2

2 years ago

4.3.1

2 years ago

4.2.3

2 years ago

4.3.0

2 years ago

4.2.2

3 years ago

4.2.1

3 years ago

4.2.0

3 years ago

4.1.12

3 years ago

4.1.13

3 years ago

4.1.14

3 years ago

4.1.11

3 years ago

4.1.8

3 years ago

4.1.7

3 years ago

4.1.6

3 years ago

4.1.5

3 years ago

4.1.4

3 years ago

4.1.3

3 years ago

4.1.2

3 years ago

4.1.1

3 years ago

4.0.0

3 years ago

4.1.0

3 years ago

3.4.0

3 years ago

3.3.3

3 years ago

3.3.1

3 years ago

3.3.0

3 years ago

3.2.1

3 years ago

3.2.0

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.4.3

3 years ago

2.4.2

3 years ago

2.4.1

3 years ago

2.4.0

3 years ago

2.3.5

3 years ago

2.3.4

3 years ago

2.3.3

3 years ago

2.3.2

3 years ago

2.3.1

3 years ago

2.3.0

3 years ago

2.2.17

3 years ago

2.2.13

4 years ago

2.2.12

4 years ago

2.2.11

4 years ago

2.2.10

4 years ago

2.2.9

4 years ago

2.2.7

4 years ago

2.2.6

4 years ago

2.2.8

4 years ago

2.2.5

4 years ago

2.2.4

4 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.0.2

4 years ago

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.27.0

4 years ago

1.27.1

4 years ago

1.26.0

4 years ago

1.25.2

4 years ago

1.25.1

4 years ago

1.25.0

4 years ago

1.24.9

4 years ago

1.24.8

4 years ago

1.24.6

4 years ago

1.24.2

4 years ago

1.24.5

4 years ago

1.24.4

4 years ago

1.24.0

4 years ago