0

Getting larger player photos

I noticed that the player image / picture URLs are available as part of the player metadata, for example:
http://l.yimg.com/a/i/us/sp/v/nba/players_...PFp0fv8wxtCIg--
which is awesome. thanks! but that's a very small 46x60 sized image.

Around the Yahoo site, there are larger 65x85 images, and I was wondering how to get the URL for those through the API. I tried the following (changing x and y):
http://l.yimg.com/a/i/us/sp/v/nba/players_...PFp0fv8wxtCIg--
http://l.yimg.com/a/i/us/sp/v/nba/players_...c=215&q=100

But those 404'ed. The correct URL (that I found manually) is:
http://l.yimg.com/a/i/us/sp/v/nba/players_...762pP7mJmXqKA--

So the key is this mysterious "sig" argument. Can we derive that somehow? can that be provided in the API somehow? are other image dimensions provided besides these two? thanks for the help!

by
9 Replies
  • We unfortunately don't currently have any way to pull out larger player images from within the webservices -- not accepting any of the right parameters that would let you specify an image size, and I'd need to figure out whether or not we actually have the right in our contract to make it easy for you to get links to the larger images. I know, it sounds silly, but people are sensitive about player images. :P Filing a bug on my end to look into it.
    0
  • QUOTE (John D @ Mar 1 2011, 09:27 AM) <{POST_SNAPBACK}>
    I noticed that the player image / picture URLs are available as part of the player metadata, for example:
    http://l.yimg.com/a/i/us/sp/v/nba/players_...PFp0fv8wxtCIg--
    which is awesome. thanks! but that's a very small 46x60 sized image.

    Around the Yahoo site, there are larger 65x85 images, and I was wondering how to get the URL for those through the API. I tried the following (changing x and y):
    http://l.yimg.com/a/i/us/sp/v/nba/players_...PFp0fv8wxtCIg--
    http://l.yimg.com/a/i/us/sp/v/nba/players_...c=215&q=100

    But those 404'ed. The correct URL (that I found manually) is:
    http://l.yimg.com/a/i/us/sp/v/nba/players_...762pP7mJmXqKA--

    So the key is this mysterious "sig" argument. Can we derive that somehow? can that be provided in the API somehow? are other image dimensions provided besides these two? thanks for the help!


    If you want the larger images, just remove the params in the query string:

    Old:
    CODE
    http://l.yimg.com/a/i/us/sp/v/nba/players_l/20101116/4244.jpg?x=46&y=60&xc=1&yc=1&wc=164&hc=215&q=100&sig=OTXf3hs63PFp0fv8wxtCIg--


    New:
    CODE
    http://l.yimg.com/a/i/us/sp/v/nba/players_l/20101116/4244.jpg


    http://l.yimg.com/a/i/us/sp/v/nba/players_...101116/4244.jpg
    0
  • QUOTE (xsicxtransitx @ Apr 20 2011, 06:44 PM) <{POST_SNAPBACK}>
    If you want the larger images, just remove the params in the query string:

    Old:
    CODE
    http://l.yimg.com/a/i/us/sp/v/nba/players_l/20101116/4244.jpg?x=46&y=60&xc=1&yc=1&wc=164&hc=215&q=100&sig=OTXf3hs63PFp0fv8wxtCIg--


    New:
    CODE
    http://l.yimg.com/a/i/us/sp/v/nba/players_l/20101116/4244.jpg


    http://l.yimg.com/a/i/us/sp/v/nba/players_...101116/4244.jpg



    If someone knew how to retrieve the larger USER images, then I'd be extremely grateful, that is to say, the larger images that show up in the Matchup page vs the smaller ones on the Team page (which are retrieved by the query).

    Ex:

    http://a323.yahoofs.com/coreid/4adf2994i1c...iAgZ3NBrtAfrAMz

    vs

    http://a323.yahoofs.com/coreid/4adf2994i1c...iAgZ3NBcwZcRMkh

    I see 48 and 96 in the png names, but changing that doesn't work unless you know how to account for the change in key at the end.
    0
  • QUOTE (xsicxtransitx @ Apr 20 2011, 06:49 PM) <{POST_SNAPBACK}>
    If someone knew how to retrieve the larger USER images, then I'd be extremely grateful, that is to say, the larger images that show up in the Matchup page vs the smaller ones on the Team page (which are retrieved by the query).

    Ex:

    http://a323.yahoofs.com/coreid/4adf2994i1c...iAgZ3NBrtAfrAMz

    vs

    http://a323.yahoofs.com/coreid/4adf2994i1c...iAgZ3NBcwZcRMkh

    I see 48 and 96 in the png names, but changing that doesn't work unless you know how to account for the change in key at the end.

    You know, I actually didn't even remember that we put this in, but it does look like we surface a "logo_size" parameter for teams. ie,

    CODE
    http://fantasysports.yahooapis.com/fantasy/v2/team/253.l.102614.t.10;logo_size=large


    The logos themselves are a bit inconsistent in size, though -- especially for the user-created logos, we're showing the 64x64 version instead of the 96x96 version, and the avatar is an entirely different sizing. So...they're generally larger, but not necessarily better.

    ...oh, that's a hassle. Okay, we also *sort of* support a size of "96" that generally returns 96x96 logos, except it doesn't work correctly for people using the default logos. I can try to fix that up, just need to see why it's such a strange access pattern for the data.

    EDIT: Ha. :PAnd just use the large image if the 96 image isn't available. Quite a bit hacky, but it'll work until we get some of this configuration stuff fixed up.
    0
  • QUOTE (xsicxtransitx @ Apr 20 2011, 06:44 PM) <{POST_SNAPBACK}>
    If you want the larger images, just remove the params in the query string:

    Old:
    CODE
    http://l.yimg.com/a/i/us/sp/v/nba/players_l/20101116/4244.jpg?x=46&y=60&xc=1&yc=1&wc=164&hc=215&q=100&sig=OTXf3hs63PFp0fv8wxtCIg--


    New:
    CODE
    http://l.yimg.com/a/i/us/sp/v/nba/players_l/20101116/4244.jpg


    http://l.yimg.com/a/i/us/sp/v/nba/players_...101116/4244.jpg


    You, my friend, are a genius. Thanks for the tip!
    0
  • QUOTE (John D @ Apr 20 2011, 08:08 PM) <{POST_SNAPBACK}>
    You, my friend, are a genius. Thanks for the tip!


    Glad I could help
    0
  • I guess Durant doesn't want us looking at his pimples &lThanks for the info, please keep me posted if you are able to serve larger photos!
    0
  • Awesome, I'll try to work this into my app before I release it, should make things look much cleaner. Thanks a lot.
    0
  • It's been a while since this thread was active, but for those still looking for a solution, here is what i did:

    <img src="http<?php $img = explode('http',$player_res['player_imgurl']); echo $img[2]; ?>

    The Explode function allows you to break up the image url and only use the piece that calls for the large image. The only part youd need to change from the above code is:
    $player_res['player_imgurl
    Simply replace that with whatever code you are using to retrieve the player image url from the database.
    0

Recent Posts

in Fantasy Sports API