You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TLDR: How can I do something like: ["league", "teams", "all", "team"] with data_key_list. There are a number of examples with a data_key_list value of ["league", "teams", "0", "team"] but this only returns a single team, I want all of them. ["league", "teams"] doesn't seem to work either because each Team object doesn't have the same values as if you do ["league", "teams", "0", "team"]. For eg with ["league", "teams"] there is no team_points property.
I am using YahooFantasySportsQuery.query to get TeamPoints for a list of Teams for a list of days with the following request:
TLDR: How can I do something like:
["league", "teams", "all", "team"]
with data_key_list. There are a number of examples with a data_key_list value of["league", "teams", "0", "team"]
but this only returns a single team, I want all of them.["league", "teams"]
doesn't seem to work either because each Team object doesn't have the same values as if you do["league", "teams", "0", "team"]
. For eg with["league", "teams"]
there is noteam_points
property.I am using
YahooFantasySportsQuery.query
to get TeamPoints for a list of Teams for a list of days with the following request:https://fantasysports.yahooapis.com/fantasy/v2/league/{league_key}/teams;team_keys={team_keys}/stats_collection;types=date;date={dates}
However, I am struggling to extract the TeamPoints from the return value, specifically with how to set
data_key_list
. I have tried values such as:["league", "teams"]
which works but the Team objects have no property TeamPoints["league", "teams", "0", "team"]
only gives the Team object for the first Team (includes TeamPoints)How do I get the TeamPoints object for each team? Something like
["league", "teams", "all", "team"]
Here is the raw response from the Yahoo API:
{'fantasy_content': {'xml:lang': 'en-US', 'yahoo:uri': '/fantasy/v2/league/427.l.97108/teams;team_keys=427.l.97108.t.1,427.l.97108.t.8/stats_collection;types=date;date=2023-10-10,2023-10-11,2023-10-12,2023-10-13,2023-10-14,2023-10-15', 'league': [{'league_key': '427.l.97108', 'league_id': '97108', 'name': 'Men2', 'url': 'https://hockey.fantasysports.yahoo.com/2023/hockey/97108', 'logo_url': False, 'draft_status': 'postdraft', 'num_teams': 8, 'edit_key': '2024-03-31', 'weekly_deadline': 'intraday', 'league_update_timestamp': '1711958417', 'scoring_type': 'headpoint', 'league_type': 'private', 'renew': '', 'renewed': '453_67269', 'felo_tier': 'bronze', 'iris_group_chat_id': '', 'allow_add_to_dl_extra_pos': 1, 'is_pro_league': '0', 'is_cash_league': '0', 'current_week': '24', 'start_week': '1', 'start_date': '2023-10-10', 'end_week': '24', 'end_date': '2024-03-31', 'is_finished': 1, 'is_plus_league': '0', 'game_code': 'nhl', 'season': '2023'}, {'teams': {'0': {'team': [[{'team_key': '427.l.97108.t.1'}, {'team_id': '1'}, {'name': 'adam2'}, [], {'url': 'https://hockey.fantasysports.yahoo.com/2023/hockey/97108/1'}, {'team_logos': [{'team_logo': {'size': 'large', 'url': 'https://s.yimg.com/cv/apiv2/default/nhl/nhl_8_a.png'}}]}, [], {'waiver_priority': 2}, [], {'number_of_moves': 23}, {'number_of_trades': 0}, {'roster_adds': {'coverage_type': 'week', 'coverage_value': 26, 'value': '0'}}, {'clinched_playoffs': 1}, {'league_scoring_type': 'headpoint'}, [], {'draft_position': 7}, {'has_draft_grade': 0}, [], [], {'managers': [{'manager': {'manager_id': '1', 'nickname': 'adam', 'guid': 'NGSXRXJK2U3UJVTCC2PO3L2A6M', 'is_commissioner': '1', 'email': 'amtadam14@hotmail.ca', 'image_url': 'https://s.yimg.com/ag/images/default_user_profile_pic_64sq.jpg', 'felo_score': '577', 'felo_tier': 'bronze'}}]}], {'team_stats_collection': [{'team_stats': {'coverage_type': 'date', 'date': '2023-10-10', 'stats': [{'stat': {'stat_id': 1, 'value': '2'}}, {'stat': {'stat_id': 2, 'value': '4'}}, {'stat': {'stat_id': 4, 'value': '1'}}, {'stat': {'stat_id': 8, 'value': '2'}}, {'stat': {'stat_id': 11, 'value': '0'}}, {'stat': {'stat_id': 14, 'value': '12'}}, {'stat': {'stat_id': 31, 'value': '2'}}, {'stat': {'stat_id': 32, 'value': '2'}}, {'stat': {'stat_id': 19, 'value': '-'}}, {'stat': {'stat_id': 22, 'value': '-'}}, {'stat': {'stat_id': 25, 'value': '-'}}, {'stat': {'stat_id': 27, 'value': '-'}}]}, 'team_points': {'coverage_type': 'date', 'date': '2023-10-10', 'total': 23.3}}, {'team_stats': {'coverage_type': 'date', 'date': '2023-10-11', 'stats': [{'stat': {'stat_id': 1, 'value': '1'}}, {'stat': {'stat_id': 2, 'value': '3'}}, {'stat': {'stat_id': 4, 'value': '1'}}, {'stat': {'stat_id': 8, 'value': '1'}}, {'stat': {'stat_id': 11, 'value': '0'}}, {'stat': {'stat_id': 14, 'value': '13'}}, {'stat': {'stat_id': 31, 'value': '5'}}, {'stat': {'stat_id': 32, 'value': '4'}}, {'stat': {'stat_id': 19, 'value': '1'}}, {'stat': {'stat_id': 22, 'value': '2'}}, {'stat': {'stat_id': 25, 'value': '34'}}, {'stat': {'stat_id': 27, 'value': '0'}}]}, 'team_points': {'coverage_type': 'date', 'date': '2023-10-11', 'total': 29}}, {'team_stats': {'coverage_type': 'date', 'date': '2023-10-12', 'stats': [{'stat': {'stat_id': 1, 'value': '0'}}, {'stat': {'stat_id': 2, 'value': '3'}}, {'stat': {'stat_id': 4, 'value': '-1'}}, {'stat': {'stat_id': 8, 'value': '1'}}, {'stat': {'stat_id': 11, 'value': '1'}}, {'stat': {'stat_id': 14, 'value': '6'}}, {'stat': {'stat_id': 31, 'value': '5'}}, {'stat': {'stat_id': 32, 'value': '1'}}, {'stat': {'stat_id': 19, 'value': '0'}}, {'stat': {'stat_id': 22, 'value': '4'}}, {'stat': {'stat_id': 25, 'value': '26'}}, {'stat': {'stat_id': 27, 'value': '0'}}]}, 'team_points': {'coverage_type': 'date', 'date': '2023-10-12', 'total': 16.1}}, {'team_stats': {'coverage_type': 'date', 'date': '2023-10-13', 'stats': [{'stat': {'stat_id': 1, 'value': '2'}}, {'stat': {'stat_id': 2, 'value': '1'}}, {'stat': {'stat_id': 4, 'value': '0'}}, {'stat': {'stat_id': 8, 'value': '2'}}, {'stat': {'stat_id': 11, 'value': '0'}}, {'stat': {'stat_id': 14, 'value': '7'}}, {'stat': {'stat_id': 31, 'value': '7'}}, {'stat': {'stat_id': 32, 'value': '0'}}, {'stat': {'stat_id': 19, 'value': '-'}}, {'stat': {'stat_id': 22, 'value': '-'}}, {'stat': {'stat_id': 25, 'value': '-'}}, {'stat': {'stat_id': 27, 'value': '-'}}]}, 'team_points': {'coverage_type': 'date', 'date': '2023-10-13', 'total': 16.3}}, {'team_stats': {'coverage_type': 'date', 'date': '2023-10-14', 'stats': [{'stat': {'stat_id': 1, 'value': '3'}}, {'stat': {'stat_id': 2, 'value': '6'}}, {'stat': {'stat_id': 4, 'value': '-2'}}, {'stat': {'stat_id': 8, 'value': '3'}}, {'stat': {'stat_id': 11, 'value': '0'}}, {'stat': {'stat_id': 14, 'value': '27'}}, {'stat': {'stat_id': 31, 'value': '6'}}, {'stat': {'stat_id': 32, 'value': '11'}}, {'stat': {'stat_id': 19, 'value': '1'}}, {'stat': {'stat_id': 22, 'value': '6'}}, {'stat': {'stat_id': 25, 'value': '56'}}, {'stat': {'stat_id': 27, 'value': '0'}}]}, 'team_points': {'coverage_type': 'date', 'date': '2023-10-14', 'total': 51.5}}, {'team_stats': {'coverage_type': 'date', 'date': '2023-10-15', 'stats': [{'stat': {'stat_id': 1, 'value': '0'}}, {'stat': {'stat_id': 2, 'value': '1'}}, {'stat': {'stat_id': 4, 'value': '-5'}}, {'stat': {'stat_id': 8, 'value': '0'}}, {'stat': {'stat_id': 11, 'value': '0'}}, {'stat': {'stat_id': 14, 'value': '8'}}, {'stat': {'stat_id': 31, 'value': '4'}}, {'stat': {'stat_id': 32, 'value': '6'}}, {'stat': {'stat_id': 19, 'value': '-'}}, {'stat': {'stat_id': 22, 'value': '-'}}, {'stat': {'stat_id': 25, 'value': '-'}}, {'stat': {'stat_id': 27, 'value': '-'}}]}, 'team_points': {'coverage_type': 'date', 'date': '2023-10-15', 'total': 7.7}}]}]}, '1': {'team': [[{'team_key': '427.l.97108.t.8'}, {'team_id': '8'}, {'name': "Kevin's Incredible Team"}, [], {'url': 'https://hockey.fantasysports.yahoo.com/2023/hockey/97108/8'}, {'team_logos': [{'team_logo': {'size': 'large', 'url': 'https://s.yimg.com/cv/apiv2/default/nhl/nhl_6_k.png'}}]}, [], {'waiver_priority': 1}, [], {'number_of_moves': 1}, {'number_of_trades': 0}, {'roster_adds': {'coverage_type': 'week', 'coverage_value': 26, 'value': '0'}}, [], {'league_scoring_type': 'headpoint'}, [], {'draft_position': 3}, {'has_draft_grade': 0}, [], [], {'managers': [{'manager': {'manager_id': '8', 'nickname': 'Kevin', 'guid': 'F7QFOTL5VP6CCDE6IZMBPBCCP4', 'email': 'fieldingkevin88@gmail.com', 'image_url': 'https://s.yimg.com/ag/images/default_user_profile_pic_64sq.jpg', 'felo_score': '486', 'felo_tier': 'bronze'}}]}], {'team_stats_collection': [{'team_stats': {'coverage_type': 'date', 'date': '2023-10-10', 'stats': [{'stat': {'stat_id': 1, 'value': '0'}}, {'stat': {'stat_id': 2, 'value': '2'}}, {'stat': {'stat_id': 4, 'value': '0'}}, {'stat': {'stat_id': 8, 'value': '0'}}, {'stat': {'stat_id': 11, 'value': '0'}}, {'stat': {'stat_id': 14, 'value': '8'}}, {'stat': {'stat_id': 31, 'value': '0'}}, {'stat': {'stat_id': 32, 'value': '2'}}, {'stat': {'stat_id': 19, 'value': '0'}}, {'stat': {'stat_id': 22, 'value': '4'}}, {'stat': {'stat_id': 25, 'value': '29'}}, {'stat': {'stat_id': 27, 'value': '0'}}]}, 'team_points': {'coverage_type': 'date', 'date': '2023-10-10', 'total': 10}}, {'team_stats': {'coverage_type': 'date', 'date': '2023-10-11', 'stats': [{'stat': {'stat_id': 1, 'value': '3'}}, {'stat': {'stat_id': 2, 'value': '0'}}, {'stat': {'stat_id': 4, 'value': '2'}}, {'stat': {'stat_id': 8, 'value': '0'}}, {'stat': {'stat_id': 11, 'value': '0'}}, {'stat': {'stat_id': 14, 'value': '15'}}, {'stat': {'stat_id': 31, 'value': '5'}}, {'stat': {'stat_id': 32, 'value': '1'}}, {'stat': {'stat_id': 19, 'value': '0'}}, {'stat': {'stat_id': 22, 'value': '5'}}, {'stat': {'stat_id': 25, 'value': '37'}}, {'stat': {'stat_id': 27, 'value': '0'}}]}, 'team_points': {'coverage_type': 'date', 'date': '2023-10-11', 'total': 21.4}}, {'team_stats': {'coverage_type': 'date', 'date': '2023-10-12', 'stats': [{'stat': {'stat_id': 1, 'value': '1'}}, {'stat': {'stat_id': 2, 'value': '2'}}, {'stat': {'stat_id': 4, 'value': '-1'}}, {'stat': {'stat_id': 8, 'value': '1'}}, {'stat': {'stat_id': 11, 'value': '0'}}, {'stat': {'stat_id': 14, 'value': '8'}}, {'stat': {'stat_id': 31, 'value': '2'}}, {'stat': {'stat_id': 32, 'value': '5'}}, {'stat': {'stat_id': 19, 'value': '1'}}, {'stat': {'stat_id': 22, 'value': '0'}}, {'stat': {'stat_id': 25, 'value': '23'}}, {'stat': {'stat_id': 27, 'value': '1'}}]}, 'team_points': {'coverage_type': 'date', 'date': '2023-10-12', 'total': 25.799999999999997}}, {'team_stats': {'coverage_type': 'date', 'date': '2023-10-13', 'stats': [{'stat': {'stat_id': 1, 'value': '1'}}, {'stat': {'stat_id': 2, 'value': '3'}}, {'stat': {'stat_id': 4, 'value': '0'}}, {'stat': {'stat_id': 8, 'value': '2'}}, {'stat': {'stat_id': 11, 'value': '0'}}, {'stat': {'stat_id': 14, 'value': '7'}}, {'stat': {'stat_id': 31, 'value': '3'}}, {'stat': {'stat_id': 32, 'value': '1'}}, {'stat': {'stat_id': 19, 'value': '-'}}, {'stat': {'stat_id': 22, 'value': '-'}}, {'stat': {'stat_id': 25, 'value': '-'}}, {'stat': {'stat_id': 27, 'value': '-'}}]}, 'team_points': {'coverage_type': 'date', 'date': '2023-10-13', 'total': 15.8}}, {'team_stats': {'coverage_type': 'date', 'date': '2023-10-14', 'stats': [{'stat': {'stat_id': 1, 'value': '1'}}, {'stat': {'stat_id': 2, 'value': '8'}}, {'stat': {'stat_id': 4, 'value': '-2'}}, {'stat': {'stat_id': 8, 'value': '3'}}, {'stat': {'stat_id': 11, 'value': '0'}}, {'stat': {'stat_id': 14, 'value': '28'}}, {'stat': {'stat_id': 31, 'value': '8'}}, {'stat': {'stat_id': 32, 'value': '5'}}, {'stat': {'stat_id': 19, 'value': '0'}}, {'stat': {'stat_id': 22, 'value': '3'}}, {'stat': {'stat_id': 25, 'value': '27'}}, {'stat': {'stat_id': 27, 'value': '0'}}]}, 'team_points': {'coverage_type': 'date', 'date': '2023-10-14', 'total': 41.1}}, {'team_stats': {'coverage_type': 'date', 'date': '2023-10-15', 'stats': [{'stat': {'stat_id': 1, 'value': '1'}}, {'stat': {'stat_id': 2, 'value': '0'}}, {'stat': {'stat_id': 4, 'value': '2'}}, {'stat': {'stat_id': 8, 'value': '0'}}, {'stat': {'stat_id': 11, 'value': '0'}}, {'stat': {'stat_id': 14, 'value': '8'}}, {'stat': {'stat_id': 31, 'value': '1'}}, {'stat': {'stat_id': 32, 'value': '1'}}, {'stat': {'stat_id': 19, 'value': '1'}}, {'stat': {'stat_id': 22, 'value': '2'}}, {'stat': {'stat_id': 25, 'value': '22'}}, {'stat': {'stat_id': 27, 'value': '0'}}]}, 'team_points': {'coverage_type': 'date', 'date': '2023-10-15', 'total': 14.6}}]}]}, 'count': 2}}], 'time': '155.75885772705ms', 'copyright': 'Certain Data by Sportradar, Stats Perform and Rotowire', 'refresh_rate': '60'}}
The text was updated successfully, but these errors were encountered: