BDubCodes.net

Posts

The NBA Skins Game

It's like a pick'em but better

Last updated on

Bill Simmons, Ryen Russillo, and Joe House did a three-part NBA preview on Bill Simmons podcast last year in October. In the third part, House revealed his concept of a "Skins Game" for the NBA season.

Here's how it works

  • Serpentine draft.
  • When you pick a team, you choose either wins or losses for that team.
  • If you picked wins, that means whenever that team wins a regular season game, you get a skin.
  • If you picked losses, that means whenever that team looses a regular season game, you get a skin.

Now this changes the stakes a bit. You aren't just racing to draft the best teams. In fact, the teams you think will suck and tank for Wembanyama are probably the most valuable ones.

The draft

I got together four other friends to play this skins game. We managed to do our draft asynchronously over Discord which was perfect. Since there was five of us, it fit perfectly with the NBA's 30 teams. We each draft six teams which means there aren't any stragglers. That means every single regular season game there is a skin at stake. The fun increases when the desired outcome matches for both drafters. If one drafter wants a win and the other wants a loss, you are rooting for the same outcome so you each get a skin.

With some conversation, some general consensus emerged to do the draft as late as possible so we could all do our research. Some of us listened to pods, others followed 538's team projections, and some followed various sportsbook's Over/Unders for season win totals.

Before the draft I prepared by making a board. My first step was to go through each team and decide if they were a pick for wins or for losses. Then I ordered based on how many skins they would get. Because we all used wildly different strategies, I was able to get lots of teams high on my board even late in the draft. I thought the Charlotte Hornets would be the 7th most valuable team. I ended up getting them 14th.

I only deviated from my board one time. My last pick, the 27th pick overall, I actually had Blazers losses one step above Pelicans wins. But I chose the Pelicans anyway, because I just felt good about that team and I thought it would be more fun to pick three teams with losses and three teams with wins.

Draft summary

  1. Adam selects the San Antonio Spurs and their LOSSES
  2. Kenneth selects the Denver Nuggets and their WINS
  3. Eristeo selects the Houston Rockets and their LOSSES
  4. Brian selects the Oklahoma City Thunder and their LOSSES
  5. Thomas selects the Detroit Pistons and their LOSSES
  6. Thomas selects the Orlando Magic and their LOSSES
  7. Brian selects the Utah Jazz and their LOSSES
  8. Eristeo selects the Indiana Pacers and their LOSSES
  9. Kenneth selects the Phoenix Suns and their WINS
  10. Adam selects the Golden State Warriors and their WINS
  11. Adam selects the Milwaukee Bucks and their WINS
  12. Kenneth selects the Memphis Grizzlies and their WINS
  13. Eristeo selects the Boston Celtics and their WINS
  14. Brian selects the Charlotte Hornets and their LOSSES
  15. Thomas selects the Sacramento Kings and their LOSSES
  16. Thomas selects the Miami Heat and their WINS
  17. Brian selects the Philadelphia 76ers and their WINS
  18. Eristeo selects the LA Clippers and their WINS
  19. Kenneth selects the Cleveland Cavaliers and their WINS
  20. Adam selects the Washington Wizards and their LOSSES
  21. Adam selects the Toronto Raptors and their WINS
  22. Kenneth selects the Atlanta Hawks and their WINS
  23. Eristeo selects the Brooklyn Nets and their WINS
  24. Brian selects the Minnesota Timberwolves and their WINS
  25. Thomas selects the Dallas Mavericks and their WINS
  26. Thomas selects the Los Angeles Lakers and their LOSSES
  27. Brian selects the New Orleans Pelicans and their WINS
  28. Eristeo selects the New York Knicks and their LOSSES
  29. Kenneth selects the Chicago Bulls and their WINS
  30. Adam selects the Portland Trail Blazers and their LOSSES

Building the summary page with NBA's stats API

One reason I was excited for this was to make a page that scraped NBA standings from somewhere and build a page that showed a full season summary of our skins game. At first, going directly to the source of stats.nba.com didn't work. Using developer tools I dug into https://www.nba.com/standings and found the network request that fetches the standings. When I tried to make this request independently using Postman, it did not work. Seems like the NBA blocks this request to keep bots or bad actors from scraping it. I looked into maybe scraping the raw HTML from the page, but the standings table is not populated server-side, so my solution would probably be pretty heavy.

After searching a lot, I came across this NBA API package a few times. It's written in Python and claims to scrape data directly from the NBA. I dug into their source, and found that they managed to do it by attaching a bunch of spoofed headers to their request. They basically made their request look like it was coming from a browser (instead of Postman or a HTTP library like Guzzle.) I copied their headers, and behold, it works.

At first I was cautious, because it seems like the NBA is putting some controls on their APIs to keep people from using it, but they aren't very strong. At first my app was only scraping at most every 24 hours, but I ended up lowering the cache expiration to 20 minutes. I don't want to get blocked and have to do manual entry or something, but I'm probably being overly cautious. I do wish that the NBA had a documented API with clearly defined usage rates that any fans could use.

And here is the skins game page for the 2022-2023 season. I might add more later, as my comrades have made their own spreadsheets to evaluate their draft value and projected skins to end the season.

It's a great way to follow the season. You pick a smattering of teams and you can find something to root for on any given night.