balldontlie icon indicating copy to clipboard operation
balldontlie copied to clipboard

easy way to find player IDs

Open edwardz8 opened this issue 2 years ago • 3 comments

is there an easier way to find a specific player ID -- maybe even by team -- than having to paginate through each "all players" query and paginating by 100?

is it possible to find all player stats from a specific team of the current season?

edwardz8 avatar Dec 01 '22 23:12 edwardz8

@edwardz8 I found it easiest to just scrape the roster for a team from ESPN (or wherever) then run a function that searches the BDL api for each player, and saves their data to firebase - all server side. Firebase might even be overkill for something like this too. If you're using something like Next/Nuxt, a JSON file would probably be good enough.

https://github.com/treyg/pistons-tracker/blob/master/server/scrape.js https://github.com/treyg/pistons-tracker/blob/master/server/index.js

treyg avatar Dec 02 '22 01:12 treyg

ah cool. i'll look into it. thanks

edwardz8 avatar Dec 02 '22 02:12 edwardz8

(as of 2023) There's a "search" parameter for the players api. You can search by first or last name.

tundey avatar Apr 03 '23 13:04 tundey