Transactions for prior years (football)? #555
Replies: 3 comments 5 replies
|
Was just looking for the exact same thing, but no leads so far. Let me know if you find a way! |
|
I think this question semi falls under this issue #546, where recent activity has not been working for some previous years. To workaround that issue I am going to look at adding transaction history to the player class. Like you mentioned though this does require kona_playercard API call to get all of that players info. Once added I don't think it would be too to get all the player cards from a teams roster. All you would need to do is get a list of all the |
|
Hi, in case this is useful to anyone, I am a idiot when it comes to programming but i figured this one out in R. Basically just pull ?view=kona_playercard for any given year, instead of ?view=kona_player_info. It will return a json for every player in the universe that year. Players have a Transactions column (?) and within that, an "Items" column. Items typically comes with two elements, one is the move for the player in question and the other is the corresponding move -- e..g when player A is dropped to make room for Player B added, one item corresponds to the player A transaction and the other is for player B. To isolate moves for the primary player -- just filter to instances of the playercard's PlayerId matching the PlayerId element embedded in Items. I expanded the json in excelt and did that filtering there. This gave me coomprehensive transacction data so i could do stuff like figure out which players have been added the most. Here's some R code that runs python too, it will generate the json. Sorry if this is obvious and/or ugly. I wrote this all for fantasy baseball in case that makes a difference: |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Very grateful for all the code and knowledge shared here. It really jump-started me to dig in and start creating some Python code.... Has anyone looked at grabbing not just 'recent' transactions, but transactions for prior years? I'd like to know, for instance, was a team's success driven by certain acquisitions vs. drafting? I used view=mTransactions2, and getting waiver and free agent moves was pretty straightforward, but trades were not. There is a TRADE_ACCEPT transaction type but it doesn't include the affected players. It does have a 'relatedTransactionId' field that seemed an obvious answer, but even when pulling all transactions for the season i could not find hits on those ids. The info in the view=kona_playercard_ appears to include trades, but backing into the answer by querying every player doesn't seem right. Not a big deal, and i know it goes beyond what espn-api does, but i went fairly far down the rabbit hole and thought maybe others have tried as well.
All reactions