[Python] Yahoo! Fantasy API Maximum Count?

Discussão em 'Python' iniciado por Stack, Dezembro 21, 2024.

  1. Stack

    Stack Membro Participativo

    I am trying to get all the available players for a position with JSON returned by the Yahoo! Fantasy API, using this resource:

    http://fantasysports.yahooapis.com/fantasy/v2/game/nfl/players;status=A;position=RB


    It seems like it always returns a maximum of 25 players with this API. I've tried using the ;count=n filter as well, but if n is anything higher that 25 I still only get 25 players returned. Does anyone know why this is? And how I can get more?

    Here is my code:

    from yahoo_oauth import OAuth1

    oauth = OAuth1(None, None, from_file='oauth.json', base_url='http://fantasysports.yahooapis.com/fantasy/v2/')

    uri = 'league/nfl.l.91364/players;position=RB;status=A;count=100'

    if not oauth.token_is_valid():
    oauth.refresh_access_token

    response = oauth.session.get(uri, params={'format': 'json'})

    Continue reading...

Compartilhe esta Página