Tank01 NFL Live In-Game Real Time Statistics NFL

ÜCRETSİZ PREMIUM
Verified
Taraf tank01 | Güncelleyen לפני 3 ימים | Sports
Popülerlik

9.7 / 10

Gecikme

278ms

Hizmet Düzeyi

100%

Health Check

N/A

Tüm Tartışmalara Dön

Fanasty Point Projection

Rapid account: Sznholds
sznholds
לפני חודשיים

Hey,

I am trying to collect data for a individual player for each week, I want to get their fantasty point projection for a single week, is there any easier way then just pulling every single projection and then parsing through it until I find the player?

Thanks!

Rapid account: Sznholds
sznholds Commented לפני חודשיים

Sweet, I wasn’t even thinking about that. You’re the best tank.

Thanks so much!

Rapid account: Tank 01
tank01 Commented לפני חודשיים

Hi sznholds,

Projections for past weeks don’t change, and our database only updates projections for “future” weeks once in every morning.

The “current” week is updated every hour.

So with that context, it would be efficient for you to keep and store locally all past week projections, and never update them. It won’t be necessary.
For future week projections, just call those once in the morning, store them locally as well, (they are updated between 6-7am Eastern), and for current week projections you can feel safe calling and storing once per hour.

Also, you don’t need to parse the file as the weekly projections come back as a json map. I don’t know what language you’re coding in, but for example let’s say you’re coding in python and you wanted Kirk Cousin’s projections for week 1.

If you called the api with week=1 into a variable called “response”, then you could simply use the following to grab his week 1 projections:

projections=json.loads(response.text)
cousinsProjections=projections[“body”][“playerProjections”].get(“14880”)

Step 1 is grabbing only the text from the response with “.text”, and then loading the response into a json object with json.loads()

Step 2 is just calling .get() using the player’s playerID. If the playerID doesn’t exist for that week then it would return None.

No need to do any real parsing.

Hope this helps!!!

Aşağıya yorum ekleyerek tartışmaya katılın:

Yeni yorumlar göndermek için giriş yapın / kaydolun