Get list of transactions after certain date #310
-
Hello, I am new to using this API, so I apologize if this question has already been asked/answered or it seems obvious. I am commissioner of a keeper league that uses a keeper deadline (i.e., a player has to be on your roster prior to a certain date in order to be eligible to be kept). I am trying to get the transactions, specifically the Adds after that date, but I can't seem to be able to write the code effectively. When I use the recent_activity function, it returns a bunch of data, but I don't think I can search by date with that. When I attempt to search the activity by add, I get a Traceback error: "AttributeError: 'League' object has no attribute 'activity'" My code snippet is below: studs = League(league_id=league_id, year=year, espn_s2=espn_s2, swid=swid) transaction = studs.recent_activity(size=60); This one works, but is inefficient since I cannot seem to search by date and changing the size is guess and check. Any assistance would be greatly appreciated. Thank you for the effort in making this available for people! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @TheWorldIMN, To get the activity of only free agents add, your code should look something like adds = studs.recent_activity(size=100, msg_type = 'FA') The Activity Object also has a This might not be the most efficient way to find it but I think it can unblock you for now. It might be a good idea to allow the caller to pass a date range to the |
Beta Was this translation helpful? Give feedback.
Hi @TheWorldIMN,
To get the activity of only free agents add, your code should look something like
The Activity Object also has a
date
field in Epoch time that can be used to determine if it was after or before your deadline.This might not be the most efficient way to find it but I think it can unblock you for now. It might be a good idea to allow the caller to pass a date range to the
recent_activity
function for extra filtering.