fantasy

Build a ten-player NBA Salary Cap squad from scratch

Returns up to three legal ten-player squads within the budget, at the frozen prices of the official market, with five back court and five front court and at most two players from one club. The budget is the 100.0M cap less the bank_to_leave reserve, so it is the cap itself only when no reserve is asked for. Use it at the start of a season, or to see what a clean sheet would look like. It SAVES NO SQUAD: the answer is a proposal, and the owner's own roster only changes when he saves one through PUT /v1/fantasy/nba/me/roster. The valuation is deliberately NOT the weekly rule. At the start of a season that rule's recent form is last season's closing minutes and it ignores the opening price, which already carries the summer. A player with a season record is valued half on what he did and half on what his price implies for his court. A player without one, or with too few games to read as a record, is valued on the price line alone and valuation_basis says which of the two it was. At the start of a season that record is LAST season's, because ours holds nothing about a season that has not started, and season_basis on each row says which season it came from. Squads are valued over the first two official Gameweeks still ahead: for every Gameday of that window the best legal five of the ten, added up, which is what the game scores. The same ten are held for the whole window and no future transfer is simulated inside it, which is what window_assumption says. window lists the Gamedays and gameweeks on each squad says what each week contributed, so a squad that gives up the first one to win the second is visible. Two Gameweeks is a product default, not a measured optimum. bank_after is what is left of the cap with the reserve named beside it rather than subtracted from it twice. This call SOLVES rather than reads: three distinct squads over two whole Gameweeks of the full market, each its own exact program. It takes up to about 30 seconds, so give it a client timeout well above that and tell a waiting user what it is doing. search says how far the search got and it is three things. 'exact' means every legal squad the budget reaches was compared. 'certified' means it stopped as soon as it could prove it was inside its optimality tolerance, and search_gap says how close to the best squad there is every squad here was proved to be, against the search_gap_tolerance it was allowed. 'truncated' means the clock ran out before it could prove anything. On anything but 'exact', say so beside the squads and say how many squads came back, because fewer than three is the shape a search that stopped early takes. When our own NBA schedule does not yet cover every Gameday of that window, this answers 409 with the sentence to show the owner rather than valuing a squad over a week it cannot see. bank_to_leave keeps money back for later moves. protected names players the squad must contain whatever the numbers say. It runs ONLY while the official market is OPEN, which is a Gameday whose deadline is still ahead. Between two seasons the collector still freezes the board the game closed the last one with, and that board names players who have retired since, so this endpoint answers 409 with the sentence to show the owner rather than building a squad out of it. Appends an immutable snapshot and changes nothing else. It never signs in to the NBA game. Owner comes from the bearer token. Requires mcp:read and fantasy:nba:write. The NBA fantasy workspace is a public beta. When the operator narrows it to a private trial, this endpoint answers 403 for an account outside it.

post/v1/fantasy/nba/me/squad-builder

Request

  • Base URL: https://api.predixsport.com (the document declares no server; this is the origin it was published from)
  • URL: https://api.predixsport.com/v1/fantasy/nba/me/squad-builder
  • Auth: none declared

Headers

preferstring nullable

Send respond-async to get 202 and a job id at once instead of waiting, then read the result at /v1/fantasy/jobs/{job_id}.

authorizationstring nullable

Request body

seasonstring nullable
bank_to_leavenumber

Millions to keep back for later moves. Zero spends it all.

protectedstring[]

Players the squad must contain whatever the numbers say.

excludedstring[]

Players to leave out.

Response

Successful Response

sport'nba'
mode'squad_builder'
snapshot_idinteger required
seasonstring required
presetstring required
policy_versionstring nullable
championstring nullable
court_source'official_market'
board_digeststring required
roster_revisioninteger required
budgetnumber required
bank_to_leavenumber required
capnumber required
value_basis'fielded_five'

Squads are ranked on the five they would field, never on a sum of the ten.

search'exact' | 'certified' | 'truncated'

'exact' means every legal squad the budget reaches was compared and these are the best there are. 'certified' means the search stopped as soon as it could prove it was inside its optimality tolerance, and search_gap says how close to the best squad there is every squad here was proved to be. 'truncated' means the search ran out of time before it could prove anything, so these are the best reached and not the best there are. On anything but 'exact', say so beside the squads and say how many squads came back.

search_gapnumber

How close to the best squad there is every squad here was PROVED to be, as a fraction: 0.004 is four tenths of a percent. Zero on an exact search.

search_gap_tolerancenumber

The optimality gap the search was allowed to stop at. The builder takes one because the exact search over two Gameweeks of a full market is slow enough to time out, and a proved half a percent is a better answer than an apology.

window_daysinteger required

How many Gamedays the squads were valued over.

window_labelstring nullable

The Gameweeks of the window, in words.

window_assumptionstring required

The assumption behind every total here, to repeat beside it: the ten are held for the whole window and no future transfer is simulated inside it.

protectedstring[]
excludedstring[]
countsobject

Changes

No recorded changes to this operation across all 1 revision of this API.