0

Getting Player Stats for a whole DEFense

Sorry probably my first attempt at asking this question was ill formed.   Here is what i need.

Just the same as i get the player_stats for Michael Vick or Tom Brady, i also want to get the "player_stats" for the Detroit Lions Defense i.e. i don;t want to have to go through every Lions defensive player tallying their pts to get the Detroit Lions Defense Team Pts total.

Hope that makes sense.

kindest

nik

by
1 Reply
  • Hi nik,

    defense players have a player id as well.

    e.g.

    http://fantasysports.yahooapis.com/fantasy/v2/player/257.p.100033/stats;type=week;week=1

    That will get the defense stats for the Baltimore Ravens for the first week:



    <?xml version="1.0" encoding="UTF-8"?>
    <fantasy_content xml:lang="en-US" yahoo:uri="http://fantasysports.yahooapis.com/
    fantasy/v2/player/257.p.100033/stats;type=week;week=1" xmlns:yahoo="http://www.y
    ahooapis.com/v1/base.rng" time="32.78112411499ms" copyright="Data provided by Ya
    hoo! and STATS, LLC" xmlns="http://fantasysports.yahooapis.com/fantasy/v2/base.r
    ng">
     <player>
      <player_key>257.p.100033</player_key>
      <player_id>100033</player_id>
      <name>
       <full>Baltimore</full>
       <first>Baltimore</first>
       <last/>
       <ascii_first>Baltimore</ascii_first>
       <ascii_last/>
      </name>
      <editorial_player_key>nfl.p.100033</editorial_player_key>
      <editorial_team_key>nfl.t.33</editorial_team_key>
      <editorial_team_full_name>Baltimore Ravens</editorial_team_full_name>
      <editorial_team_abbr>Bal</editorial_team_abbr>
      <bye_weeks>
       <week>5</week>
      </bye_weeks>
      <uniform_number></uniform_number>
      <display_position>DEF</display_position>
      <image_url>http://l.yimg.com/a/i/us/sp/v/blank_player2.gif?x=46&y=60&xc=1&yc=1&wc=164&hc=215&q=100&sig=8G0MjQyD1AdYbnv.fd2Wog--</image_url>
      <is_undroppable>0</is_undroppable>
      <position_type>DT</position_type>
      <eligible_positions>
       <position>DEF</position>
      </eligible_positions>
      <player_stats>
       <coverage_type>week</coverage_type>
       <week>1</week>
       <stats>
        <stat>
         <stat_id>0</stat_id>
         <value>1</value>
        </stat>
        <stat>
         <stat_id>31</stat_id>
         <value>7</value>
        </stat>
        <stat>
         <stat_id>32</stat_id>
         <value>4</value>
        </stat>
        <stat>
         <stat_id>33</stat_id>
         <value>3</value>
        </stat>
        <stat>
         <stat_id>34</stat_id>
         <value>4</value>
        </stat>
        <stat>
         <stat_id>35</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>36</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>37</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>48</stat_id>
         <value>37</value>
        </stat>
        <stat>
         <stat_id>49</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>50</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>51</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>52</stat_id>
         <value>1</value>
        </stat>
        <stat>
         <stat_id>53</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>54</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>55</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>56</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>67</stat_id>
         <value>1</value>
        </stat>
        <stat>
         <stat_id>68</stat_id>
         <value>8</value>
        </stat>
        <stat>
         <stat_id>69</stat_id>
         <value>312</value>
        </stat>
        <stat>
         <stat_id>70</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>71</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>72</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>73</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>74</stat_id>
         <value>1</value>
        </stat>
        <stat>
         <stat_id>75</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>76</stat_id>
         <value>0</value>
        </stat>
        <stat>
         <stat_id>77</stat_id>
         <value>3</value>
        </stat>
       </stats>
      </player_stats>
     </player>
    </fantasy_content>



    Hope that helps.



    QUOTE(nik @ 24 Sep 2011 10:31 AM)
    Sorry probably my first attempt at asking this question was ill formed.   Here is what i need.

    Just the same as i get the player_stats for Michael Vick or Tom Brady, i also want to get the "player_stats" for the Detroit Lions Defense i.e. i don;t want to have to go through every Lions defensive player tallying their pts to get the Detroit Lions Defense Team Pts total.

    Hope that makes sense.

    kindest

    nik
    0

Recent Posts

in Fantasy Sports API