Tank01 NFL Live In-Game Real Time Statistics NFL

FREEMIUM
Verified
By tank01 | Updated 2 days ago | Sports
Popularity

9.8 / 10

Latency

375ms

Service Level

100%

Health Check

N/A

Back to All Discussions

D/ST handling - suggestions?

Rapid account: Rowan 66
rowan66
4 months ago
Hey, One thing that often gets a little confusing or overlooked seems to be D/ST with regards to 'players' in FF.

Obviously, there is a players endpoint and list, which does include players who have defensive positions, but this can be a bit tricky when dealing with fantasy football D/ST positions and tracking points etc.

Would there be any interest or possibility of adding in some sort of catch-all for D/ST, almost like adding in each team as a D/ST into the players list?

Open to suggestions here 😃

Rapid account: Rowan 66
rowan66 Commented 4 months ago

no problem, please do - happy to help.

Rapid account: Tank 01
tank01 Commented 4 months ago

No problem Rowan! Also at some point I’m going to mess around with that yahoo API so I might end up emailing you on this if you don’t mind.

Rapid account: Rowan 66
rowan66 Commented 4 months ago

haha well done, and thankyou!

I also finished the logic to handle the DST problem for yahoo roster imports. i’ll have to wait and see how the playbyplay handled DST related plays to see if my implementation will work but its a start 😃 thanks for your work on this, it really is awesome.

Rapid account: Tank 01
tank01 Commented 4 months ago

Hi guys I got anxious and couldn’t help myself. Safeties in both teamStats and DST have been implemented for all games this season and will be available for live scoring this weekend, and moving forward.

Thanks again for the suggestions!

Rapid account: Tank 01
tank01 Commented 4 months ago

Just to update everyone following this thread. Yes I’ll be able to get safeties in the database by this weekend. Should have all games from this season converted by Saturday night, and have it working for live scoring for the two games this weekend.

Safeties will be tallied in the “teamStats” element, in the appropriate away/home map, as “safeties”, as well as in the “DST” element, again in the appropriate away/home map, as “safeties”. Like all of the other numeric elements, it will be stored as a string.

I’ll update here once this is complete. Exciting!

Rapid account: Tank 01
tank01 Commented 4 months ago

Hi ethkatnic, yes safeties are missing.

Safeties are not traditionally listed in box scores, and I’ve been spending a lot of time trying to allocate those kinds of stats appropriately to the playerIDs that they belong to. Because they’re not normally in box scores, there’s some magic I have to work to make this happen. This is an ongoing effort that i hope to be complete with in a couple of months.

With that said, I do think I can add safeties to the DST element sooner than later. Let me focus some time on that tonight and I’ll keep you posted.

Thanks for your feedback on this!!!

Rapid account: Ethkatnic
ethkatnic Commented 4 months ago

One follow up on this - the DST changes to the box score endpoint look fantastic and are super helpful. Thank you!

The only defensive stat that I don’t see in the DST section is safeties . Would it be possible to add these as well?

Rapid account: Tank 01
tank01 Commented 4 months ago

Thank you for this. Funny I was about to write you back here and ask for some info on that API. I’ll take a look.

My main priority over the next few weeks/months will be enhancing the play by play to add stats to it… just fyi

Rapid account: Rowan 66
rowan66 Commented 4 months ago

You’re definitely right of course - i think adding in the extra logic is probably going to have to be done, but since you asked:

If you get the https://fantasysports.yahooapis.com/fantasy/v2/team/<league/TeamKey>/roster endpoint to retrieve the roster of the authenticated user, the DST spots are returned the same as players, with player_id there:

<player>
<player_key>423.p.100005</player_key>
<player_id>100005</player_id>
<name>
<full>Cleveland</full>
<first>Cleveland</first>
<last/>
<ascii_first>Cleveland</ascii_first>
<ascii_last/>
</name>
<url>https://sports.yahoo.com/nfl/teams/cleveland/</url>
<editorial_player_key>nfl.p.100005</editorial_player_key>
<editorial_team_key>nfl.t.5</editorial_team_key>
<editorial_team_full_name>Cleveland Browns</editorial_team_full_name>
<editorial_team_abbr>Cle</editorial_team_abbr>
<editorial_team_url>https://sports.yahoo.com/nfl/teams/cleveland/</editorial_team_url>
<bye_weeks>
<week>5</week>
</bye_weeks>
<is_keeper>
<status></status>
<cost></cost>
<kept></kept>
</is_keeper>
<uniform_number></uniform_number>
<display_position>DEF</display_position>
<headshot>
<url>https://s.yimg.com/lq/i/us/sp/v/nfl/teams/1/50x50w/cle.gif</url>
<size>small</size>
</headshot>
<image_url>https://s.yimg.com/lq/i/us/sp/v/nfl/teams/1/50x50w/cle.gif</image_url>
<is_undroppable>0</is_undroppable>
<position_type>DT</position_type>
<primary_position>DEF</primary_position>
<eligible_positions>
<position>DEF</position>
</eligible_positions>
<eligible_positions_to_add/>
<selected_position>
<coverage_type>week</coverage_type>
<week>17</week>
<position>DEF</position>
<is_flex>0</is_flex>
</selected_position>
<is_editable>0</is_editable>
</player>

Rapid account: Tank 01
tank01 Commented 4 months ago

This is interesting. I didn’t realize yahoo has playerID’s for their DS/T. I just checked my different fantasy leagues and if I click on a “DS/T”, I don’t get a playerID. I just get a team name. For instance, clicking on the Colts D/ST on their site takes me to https://sports.yahoo.com/nfl/teams/indianapolis/. I don’t use the yahoo API at all. Where can I find this yahoo player ID for DS/T outside of their API? Or is that the only place?

With that said, I think this would be a simple mapping exercise on your end with an if statement when pulling back “player stats”. You can have a list of the 32 teams “yahoo playerID” and have your code say if playerID in this list, then grab team stats from tank01, else, grab player stats from tank01. If it is grabbing team stats then just map that player ID to the teamID in our database. This action would be probably around 1ms your end so the performance hit would be negligible.

This could be done on my side but then I’m dealing with explaining to people why one schema with player ID would look one way and the other schema that returns a team would look totally different.

Thoughts?

Join in the discussion - add comment below:

Login / Signup to post new comments