Transactions collection

Description

With the Transactions API, you can obtain information via GET from a collection of transactions simultaneously. The transactions collection is qualified in the URI by a particular league. Each element beneath the Transactions Collection will be a Transaction Resource

You can also POST to the API to perform operations like adding and/or dropping players to/from a team and proposing trades.

HTTP Operations Supported

URIs

URI Description Sample
http://fantasysports.yahooapis.com/fantasy/v2/league/{league_key}/transactions Fetch all completed transactions within a league.

http://fantasysports.yahooapis.com/fantasy/v2/league/223.l.431/transactions

http://fantasysports.yahooapis.com/fantasy/v2/transactions;transaction_keys={transaction_key1},{transaction_key2} Fetch specific transactions {transaction_key1} and {transaction_key2}

http://fantasysports.yahooapis.com/fantasy/v2/transactions;transaction_keys=223.l.431.tr.26,223.l.431.tr.27

http://fantasysports.yahooapis.com/fantasy/v2/leagues;league_keys={league_key1},{league_key2}/transactions Fetch all completed transactions of the leagues {league_key1} and {league_key2}

http://fantasysports.yahooapis.com/fantasy/v2/leagues;league_keys=223.l.431,223.l.21821/transactions

http://fantasysports.yahooapis.com/fantasy/v2/league/{league_key}/transactions;types=waiver,pending_trade;team_key={team_key} Fetch all pending trades and waivers relevant to the particular team.

http://fantasysports.yahooapis.com/fantasy/v2/league/223.l.431/transactions;types=waiver,pending_trade;team_key=223.l.431.t.1

Any sub-resource valid for a transaction is a valid sub-resource under the transactions collection.

Any sub-resource for a collection of transactions is extracted using a URI like:

/transactions/{sub_resource}

OR

/transactions;transaction_keys={transaction_key1},{transaction_key2}/{sub_resource}

Multiple sub-resources can be extracted from transactions in the same URI using a format like:

/transactions;out={sub_resource_1},{sub_resource_2}

OR

/transactions;transaction_keys={transaction_key1},{transaction_key2};out={sub_resource_1},{sub_resource_2}

Filters

The transactions collection can have filters such as the following to obtain a subset of a transactions collection that satisfy the filtering condition. These filters can be combined to obtain a more restricted list of transactions.

Filter parameter Filter parameter values Usage
type add,drop,commish,trade /transactions;type=add
types Any valid types /transactions;types=add,trade
team_key A team_key within the league /transactions;team_key=257.l.193.t.1
type with team_key waiver,pending_trade You can only use these options when also providing the team_key, ie /transactions;team_key=257.l.193.t.1;type=waiver
count Any integer greater than 0 /transactions;count=5

POST

Using POST, players can be added and/or dropped from a team, or trades can be proposed. The URI for POSTing to transactions collection is:

http://fantasysports.yahooapis.com/fantasy/v2/league/{league_key}/transactions

Adding/Dropping Players

The input XML format for a POST request to the transactions API for adding a player is:

The input XML format for a POST request to the transactions API for dropping a player is:

The input XML format for a POST request to the transactions API for replacing one player with another player in a team is:

You may also add players that are currently on waivers -- the players will not be immediately added to your team, but rather, you will be returned back a waiver claim that will be processed at some point in the future. Various league rules will control in which conditions you will actually receive the player, in the case that multiple teams have placed waiver claims.

If you are placing a waiver claim in a league that uses FAAB, you may add that to the XML that you POST:

Once you have a waiver claim transaction, you may also edit the waiver priority or FAAB bid, or cancel the waiver entirely.

Proposing Trades

The input XML format for a POST request to the transactions API for proposing a trade is:

Once you have a pending trade transaction, you may accept, reject, allow/disallow, or vote against the trade (depending on which role you have in the league). You may also cancel the trade.

Table of Contents