fantasy

Pick my best Fantacalcio lineup for the open matchweek

Runs the exact Classic lineup optimiser over your saved squad and the open matchweek, and appends one immutable recommendation. The answer is a whole LINEUP, not a ranking: it chooses the formation, the eleven and the order of the bench together, because the substitution rule scores the bench in the order you leave it and a formation that fits your best players is worth more than any single pick. module pins one formation instead. forced_in treats a player as a sure starter and forced_out leaves him out. Both take player codes from your own squad, and a code you do not own is refused rather than quietly ignored. The optimiser maximises the lineup's expected score UNDER YOUR LEAGUE'S SUBSTITUTION RULE (selection_total): a starter who does not play is replaced from the bench the way your league's substitution_mode says (same role only, or a module change when no same-role reserve has a vote), up to your league's limit, so a better player with a real chance of starting can start over a surer one when the bench covers him. It never starts a player less likely than not to start unless you force him. expected_substitutions and hole_probability say what that risk costs: the latter is the probability of not fielding eleven voted players after every substitution your league's mode allows, and the answer echoes the substitution_mode it was priced under. Present the lineup with projected_points, which is what it is worth if everybody plays, and keep expected_defence as its own line. what_if says what would change if a doubtful bench player were confirmed, and ballottaggi names the closest call in each role. This is advice: it writes a snapshot on Predixsport and nothing else. It never signs in to any fantasy platform and never submits your lineup. Requires mcp:read and fantasy:fantacalcio:write. The Fantacalcio workspace is in a private beta: this endpoint answers 403 for an account outside it.

post/v1/fantasy/fantacalcio/me/optimize

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/fantacalcio/me/optimize
  • Auth: none declared

Headers

authorizationstring nullable

Request body

seasonstring nullable

Omitted uses the latest season you saved.

teaminteger nullable
modulestring nullable

Pin one formation, e.g. '4-4-2'. Omitted lets the optimiser choose among the formations your league allows.

forced_instring[]

Players to treat as sure starters, as codes from your own squad. A code you do not own is refused rather than ignored.

forced_outstring[]

Players to leave out, as codes from your own squad.

Response

Successful Response

snapshot_idinteger required
seasonstring required
teaminteger required
giornatainteger required
created_atstring date-time required
applied_atstring date-time nullable
staleboolean

True when the squad or the board moved after this advice was computed. Run the optimiser again rather than acting on it.

policy_versionstring required
modulestring required
startersstring[] required
bench_orderstring[] required
selection_totalnumber required

The optimiser's own objective. Since policy_version fantacalcio-lineup-v3 it is the expected score of this eleven AND its bench under your league's substitution rule: a starter who does not play is replaced from the bench the way the league's substitution_mode says (same role only, or a module change when no same-role reserve has a vote), while your league's substitution limit lasts, plus the defence modifier weighted by the chance it is paid. Older snapshots (v2 and earlier) carry the plain sum of selection scores, which ignored substitutions.

expected_substitutionsnumber

How many substitutions the league's rule is expected to make for this lineup. 0 on snapshots older than fantacalcio-lineup-v3.

hole_probabilitynumber

Probability of NOT fielding eleven voted players: at least one slot stays without a vote after every substitution the league's substitution_mode allows, because no eligible reserve is left on the bench or the substitution limit is spent. Since fantacalcio-lineup-v4 it follows the league's mode (a module change can fill a slot the same-role rule could not). 0 on snapshots older than fantacalcio-lineup-v3.

substitution_mode'traditional' | 'hybrid' | 'dynamic'

The substitution rule this advice was priced under, echoed from the league rules at the time. Snapshots older than fantacalcio-lineup-v4 report 'traditional', the same-role walk they were computed with.

projected_pointsnumber required

What this eleven is worth if everybody in it plays: the starters' projected fantavoti plus the expected defence modifier. This is the number to show a reader.

expected_defencenumber required

The defence modifier in points. Always shown separately.

playersobject required
player_countinteger required
omitted_player_countinteger

Changes

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