ynnadkrap / balldontlie

NBA API
http://www.balldontlie.io
225 stars 19 forks source link

easy way to find player IDs #99

Open edwardz8 opened 1 year ago

edwardz8 commented 1 year ago

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?

treyg commented 1 year ago

@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

edwardz8 commented 1 year ago

ah cool. i'll look into it. thanks

tundey commented 1 year ago

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