Ejemplo n.º 1
0
        public static DataSet GetBoxScoreTraditionalV2(string gameId)
        {
            // https://stats.nba.com/stats/boxscoretraditionalv2?EndPeriod=10&EndRange=28800&GameID=0011800076&RangeType=0&Season=2018-19&SeasonType=Pre+Season&StartPeriod=1&StartRange=0

            String s = $"boxscoretraditionalv2?EndPeriod=10&EndRange=28800&GameID={gameId}&RangeType=0&StartPeriod=1&StartRange=0";

            return(NBAStats.ReadApiResultSet(NBAStats.StatsApiGet($"boxscoretraditionalv2?EndPeriod=10&EndRange=28800&GameID={gameId}&RangeType=0&StartPeriod=1&StartRange=0"), "boxscoretraditionalv2wholegame"));
        }
Ejemplo n.º 2
0
        public static DataSet GetPlayByPlay(String gameId)
        {
            // https://stats.nba.com/stats/playbyplayv2?GAMEID=0011800018&StartPeriod=0&EndPeriod=0

            return(NBAStats.ReadApiResultSet(NBAStats.StatsApiGet($"playbyplay?GAMEID={gameId}&StartPeriod=0&EndPeriod=0"), "playbyplay", new List <string> {
                "PlayByPlay"
            }));
        }
Ejemplo n.º 3
0
        public static DataSet GetBoxscoreSummary(string gameId)
        {
            var tablesToInclude = new List <string> {
                "GameInfo", "GameSummary", "InactivePlayers", "LineScore", "Officials", "OtherStats", "TeamGameLogs"
            };

            DataSet ds = NBAStats.ReadApiResultSet(NBAStats.StatsApiGet($"boxscoresummaryv2/?gameId={gameId}"), "teamgamelogs", tablesToInclude);

            ds = NBAStats.UpdateApiResultSetWithValues(ds, new Dictionary <string, object> {
                { "GAME_ID", gameId }
            });

            return(ds);
        }
Ejemplo n.º 4
0
        //public static DataSet GetShotChartDetail(String gameId)
        //{
        //    // https://stats.nba.com/stats/shotchartdetail?AheadBehind=&CFID=&CFPARAMS=&ClutchTime=&Conference=&ContextFilter=&ContextMeasure=FGA&DateFrom=05%2F31%2F2018&DateTo=&Division=&EndPeriod=10&EndRange=28800&GROUP_ID=&GameEventID=&GameID=&GameSegment=&GroupID=&GroupMode=&GroupQuantity=5&LastNGames=0&LeagueID=00&Location=&Month=0&OnOff=&OpponentTeamID=0&Outcome=&PORound=0&Period=0&PlayerID=2544&PlayerID1=&PlayerID2=&PlayerID3=&PlayerID4=&PlayerID5=&PlayerPosition=&PointDiff=&Position=&RangeType=0&RookieYear=&Season=2017-18&SeasonSegment=&SeasonType=Playoffs&ShotClockRange=&StartPeriod=1&StartRange=0&StarterBench=&TeamID=1610612739&VsConference=&VsDivision=&VsPlayerID1=&VsPlayerID2=&VsPlayerID3=&VsPlayerID4=&VsPlayerID5=&VsTeamID=

        //    String a = $"https://stats.nba.com/stats/shotchartdetail?AheadBehind=&CFID=&CFPARAMS=&ClutchTime=&Conference=&ContextFilter=&ContextMeasure=FGA&DateFrom=05%2F31%2F2018&DateTo=&Division=&EndPeriod=10&EndRange=28800&GROUP_ID=&GameEventID=&GameID=0011800018&GameSegment=&GroupID=&GroupMode=&GroupQuantity=5&LastNGames=0&LeagueID=00&Location=&Month=0&OnOff=&OpponentTeamID=0&Outcome=&PORound=0&Period=0&PlayerID=2544&PlayerID1=&PlayerID2=&PlayerID3=&PlayerID4=&PlayerID5=&PlayerPosition=&PointDiff=&Position=&RangeType=0&RookieYear=&Season=2017-18&SeasonSegment=&SeasonType=Playoffs&ShotClockRange=&StartPeriod=1&StartRange=0&StarterBench=&TeamID=1610612745&VsConference=&VsDivision=&VsPlayerID1=&VsPlayerID2=&VsPlayerID3=&VsPlayerID4=&VsPlayerID5=&VsTeamID=";
        //}

        // Get games for day
        // https://stats.nba.com/stats/scoreboardV2?DayOffset=0&LeagueID=00&gameDate=10%2F06%2F2018

        public static DataSet GetTeamGameLogs(int seasonStartingYear, SeasonType seasonType, string teamId, DateTime?fromDate, DateTime?toDate, String leagueId = "00")
        {
            String fromDateFormatted = FormatDateTimeToString(fromDate, "");
            String toDateFomatted    = FormatDateTimeToString(toDate, "");

            String season = FormatSeason(seasonStartingYear);

            if (String.IsNullOrEmpty(teamId))
            {
                teamId = "0";
            }

            String uri = $"teamgamelogs?DateFrom={fromDate}&DateTo={toDate}&GameSegment=&LastNGames=0&LeagueID={leagueId}&Location=&MeasureType=Base&Month=0&OpponentTeamID={teamId}&Outcome=&PORound=0&PaceAdjust=N&PerMode=Totals&Period=0&PlusMinus=N&Rank=N&Season={season}&SeasonSegment=&SeasonType={FormatSeasonType(seasonType)}&ShotClockRange=&TeamID=&VsConference=&VsDivision=";

            return(NBAStats.ReadApiResultSet(NBAStats.StatsApiGet(uri), "teamgamelogs"));
        }