npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cbb-npm

v1.0.7

Published

Retrieves sports data from a popular sports website as well as from the ncaa website, with support for men's and women's college basketball, NBA, WNBA, NFL and CFB.

Downloads

25

Readme

cbb-npm

Support for the following data from ESPN's college basketball endpoints:

  • play-by-play (including shot location data when available)
  • scores
  • schedule
  • standings
  • rankings

Support for the following data from ESPN's endpoints and recruiting data from 247Sports:

  • play-by-play (including shot location data when available)
  • scores
  • schedule
  • standings
  • rankings (not available for WNBA/NBA)

Recruiting data from 247Sports available for:

  • men's college basketball
  • college football

The following sports are available from ESPN:

  • College Basketball
  • Women's College Basketball
  • WNBA
  • NBA
  • All team sports on the NCAA website:
    • 'football'
    • 'basketball-men'
    • 'basketball-women'
    • 'soccer-men'
    • 'soccer-women'
    • 'fieldhockey'
    • 'volleyball-women'
    • 'icehockey-men'
    • 'icehockey-women'
    • 'baseball'
    • 'beach-volleyball'
    • 'lacrosse-men'
    • 'lacrosse-women'
    • 'volleyball-men'

Installation

npm install cbb-npm

Usage

const sdv = require('cbb-npm');

Examples

Men's College Basketball

CBB Games

const gameId = 401260281;

// get detailed play-by-play data for a game
const result = await sdv.cbbGames.getPlayByPlay(gameId);

// get box score
const result = await sdv.cbbGames.getBoxScore(gameId);

// get game all game data
const summary = await sdv.cbbGames.getSummary(gameId);

// get all game pickcenter data
const picks = await sdv.cbbGames.getPicks(gameId);

CBB Scores

const inputs = {
    year: 2021,
    month: 02,
    day: 15
};
const result = await sdv.cbbScoreboard.getScoreboard(inputs);

CBB Schedules

const inputs = {
    groups: 50, // all Div-I games
    year: 2020,
    month: 12,
    day: 02
};

const result = await sdv.cbbSchedule.getSchedule(inputs);

CBB Conferences

const results = await sdv.cbbScoreboard.getConferences();

CBB Teams

// get list of teams
const result = await sdv.cbbTeams.getTeamList();

// get individual team data
const teamId = 52;
const result = await sdv.cbbTeams.getTeamInfo(teamId);

// get team roster data
const result = await sdv.cbbTeams.getTeamPlayers(teamId);

CBB Rankings

// get rankings
const inputs = {
    year: 2020,
    week: 19
};

const result = await sdv.cbbRankings.getRankings(inputs);

CBB Standings

// get standings
const inputs = {
    year: 2020
};

const result = await sdv.cbbStandings.getStandings(inputs);

CBB Recruiting

// get recruiting data from 247Composite
// get player rankings
const result = await sdv.cbbRecruiting.getPlayerRankings({
                    year: 2016
                });

const result = await sdv.cbbRecruiting.getPlayerRankings({
                    year: 2021,
                    position: "C"
                });

const result = await sdv.cbbRecruiting.getPlayerRankings({
                    year: 2020,
                    group: "JuniorCollege"
                });

// get school rankings
const result = await sdv.cbbRecruiting.getSchoolRankings(2021);

// get a school's commit list
const result = await sdv.cbbRecruiting.getSchoolCommits('floridastate', 2020);

Women's College Basketball

WBB Games

const gameId = 401260281;

// get detailed play-by-play data for a game
const result = await sdv.wbbGames.getPlayByPlay(gameId);

// get box score
const result = await sdv.wbbGames.getBoxScore(gameId);

// get game all game data
const summary = await sdv.wbbGames.getSummary(gameId);

WBB Scores

const inputs = {
    year: 2021,
    month: 02,
    day: 15
};
const result = await sdv.wbbScoreboard.getScoreboard(inputs);

WBB Schedules

const inputs = {
    groups: 50, // all Div-I games
    year: 2020,
    month: 12,
    day: 02
};

const result = await sdv.wbbSchedule.getSchedule(inputs);

WBB Conferences

const results = await sdv.wbbScoreboard.getConferences();

WBB Teams

// get list of teams
const result = await sdv.wbbTeams.getTeamList();

// get individual team data
const teamId = 52;
const result = await sdv.wbbTeams.getTeamInfo(teamId);

// get team roster data
const result = await sdv.wbbTeams.getTeamPlayers(teamId);

WBB Rankings

// get rankings
const inputs = {
    year: 2020,
    week: 19
};

const result = await sdv.wbbRankings.getRankings(inputs);

WBB Standings

// get standings
const inputs = {
    year: 2020
};

const result = await sdv.wbbStandings.getStandings(inputs);

NCAA Data

NCAA Scoreboard

// acceptable sport names:
// ['football' ,'basketball-men', 'basketball-women',
//  'soccer-men','soccer-women','fieldhockey',
//  'volleyball-women','beach-volleyball',
//  'icehockey-men','icehockey-women',
//  'baseball',  'volleyball-men',
//  'lacrosse-men', 'lacrosse-women']
// get ncaa scoreboard data for sport from above list
// (default: 'basketball-men')
const result = await sdv.ncaaScoreboard.getNcaaScoreboard(
    sport = 'basketball-men', division = 'd1', year = 2020, month = 02, day = 15
)

NCAA Games

// NCAA game information for a given game id
const result = await sdv.ncaaGame.getNcaaInfo(5764053);

// NCAA box score for a given game id
const result = await sdv.ncaaGame.getNcaaBoxScore(5764053);

// NCAA play-by-play for a given game id
const result = await sdv.ncaaGame.getNcaaPlayByPlay(5764053);

// NCAA game team stats for a given game (appears to only exist for football)
const result = await sdv.ncaaGame.getNcaaTeamStats(5772253);

// NCAA game scoring summary for a given game (appears to only exist for football)
const result = await sdv.ncaaGame.getNcaaScoringSummary(5772253);

NBA

NBA Games

const gameId = 401283399;

// get detailed play-by-play data for a game
const result = await sdv.nbaGames.getPlayByPlay(gameId);

// get box score
const result = await sdv.nbaGames.getBoxScore(gameId);

// get game all game data
const summary = await sdv.nbaGames.getSummary(gameId);

// get all game pickcenter data
const picks = await sdv.nbaGames.getPicks(gameId);

NBA Scores

const inputs = {
    year: 2021,
    month: 02,
    day: 15
};
const result = await sdv.nbaScoreboard.getScoreboard(inputs);

NBA Schedules

const inputs = {
    groups: 46, // nba group code
    year: 2020,
    month: 12,
    day: 02
};

const result = await sdv.nbaSchedule.getSchedule(inputs);

NBA Conferences

const results = await sdv.nbaScoreboard.getConferences();

NBA Teams

// get list of teams
const result = await sdv.nbaTeams.getTeamList();

// get individual team data
const teamId = 16;
const result = await sdv.nbaTeams.getTeamInfo(teamId);

// get team roster data
const result = await sdv.nbaTeams.getTeamPlayers(teamId);

NBA Standings

// get standings
const inputs = {
    year: 2020
};

const result = await sdv.nbaStandings.getStandings(inputs);

WNBA

WNBA Games

const gameId = 401244185;

// get detailed play-by-play data for a game
const result = await sdv.wnbaGames.getPlayByPlay(gameId);

// get box score
const result = await sdv.wnbaGames.getBoxScore(gameId);

// get game all game data
const summary = await sdv.wnbaGames.getSummary(gameId);

WNBA Scores

const inputs = {
    year: 2021,
    month: 02,
    day: 15
};
const result = await sdv.wnbaScoreboard.getScoreboard(inputs);

WNBA Schedules

const inputs = {
    groups: 59, // wnba group code
    year: 2020,
    month: 12,
    day: 02
};

const result = await sdv.wnbaSchedule.getSchedule(inputs);

WNBA Conferences

const results = await sdv.wnbaScoreboard.getConferences();

WNBA Teams

// get list of teams
const result = await sdv.wnbaTeams.getTeamList();

// get individual team data
const teamId = 14;
const result = await sdv.wnbaTeams.getTeamInfo(teamId);

// get team roster data
const result = await sdv.wnbaTeams.getTeamPlayers(teamId);

WNBA Standings

// get standings
const inputs = {
    year: 2020
};

const result = await sdv.wnbaStandings.getStandings(inputs);

NFL

NFL Games

const gameId = 401220403;

// get detailed play-by-play data for a game
const result = await sdv.nflGames.getPlayByPlay(gameId);

// get box score
const box = await sdv.nflGames.getBoxScore(gameId);

// get all game data
const summary = await sdv.nflGames.getSummary(gameId);

// get all game pickcenter data
const picks = await sdv.nflGames.getPicks(gameId);

NFL Scores

const inputs = {
    year: 2021,
    month: 02,
    day: 07
};
const result = await sdv.nflScoreboard.getScoreboard(inputs);

NFL Schedules

const inputs = {
    groups: 20, // nfl group code
    year: 2021,
    month: 02,
    day: 07
};

const result = await sdv.nflSchedule.getSchedule(inputs);

NFL Conferences

const results = await sdv.nflScoreboard.getConferences();

NFL Teams

// get list of teams
const result = await sdv.nflTeams.getTeamList();

// get individual team data
const teamId = 27;
const result = await sdv.nflTeams.getTeamInfo(teamId);

// get team roster data
const result = await sdv.nflTeams.getTeamPlayers(teamId);

NFL Standings

// get standings
const inputs = {
    year: 2020
};

const result = await sdv.nflStandings.getStandings(inputs);

College Football

CFB Games

const gameId = 401256194;

// get detailed play-by-play data for a game
const result = await sdv.cfbGames.getPlayByPlay(gameId);

// get box score
const result = await sdv.cfbGames.getBoxScore(gameId);

// get game all game data
const summary = await sdv.cfbGames.getSummary(gameId);

// get all game pickcenter data
const picks = await sdv.cfbGames.getPicks(gameId);

CFB Scores

const inputs = {
    year: 2021,
    month: 12,
    day: 15
};
const result = await sdv.cfbScoreboard.getScoreboard(inputs);

CFB Schedules

const inputs = {
    groups: 80, // all Div-I games
    year: 2020,
    month: 12,
    day: 02
};

const result = await sdv.cfbSchedule.getSchedule(inputs);

CFB Conferences

const results = await sdv.cfbScoreboard.getConferences();

CFB Teams

// get list of teams
const result = await sdv.cfbTeams.getTeamList();

// get individual team data
const teamId = 52;
const result = await sdv.cfbTeams.getTeamInfo(teamId);

// get team roster data
const result = await sdv.cfbTeams.getTeamPlayers(teamId);

CFB Rankings

// get rankings
const inputs = {
    year: 2020,
    week: 12
};

const result = await sdv.cfbRankings.getRankings(inputs);

CFB Standings

// get standings
const inputs = {
    year: 2020
};

const result = await sdv.cfbStandings.getStandings(inputs);

CFB Recruiting

// get recruiting data from 247Composite
// get player rankings
const result = await sdv.cfbRecruiting.getPlayerRankings({
                    year: 2016
                });

const result = await sdv.cfbRecruiting.getPlayerRankings({
                    year: 2021,
                    position: "DT"
                });

const result = await sdv.cfbRecruiting.getPlayerRankings({
                    year: 2020,
                    group: "JuniorCollege"
                });

// get school rankings
const result = await sdv.cfbRecruiting.getSchoolRankings(2021);

// get a school's commit list
const result = await sdv.cfbRecruiting.getSchoolCommits('floridastate', 2020);