PokerDataGet an API key
Menu

Hand-history grading

Send raw hand histories and get every hero decision graded against solver play, with EV loss in big blinds.

POST /api/v1/grade/hands grades every decision the hero made in one or more hand histories. Send the hand-history text exactly as the site exported it. Each decision comes back with:

  • the solver's frequency for every action, with the EV and EV loss in big blinds where it has them;
  • the hero's EV loss, in big blinds and as a share of the pot.

There are no tiers or scores: you set your own thresholds for what counts as a mistake.

Each hand and the whole request also get totals.

What gets graded

Supported
GameNo-limit hold'em
Cash2–6 players, graded against the 6-max 100bb ranges at the nearest stack depth
Tournaments2–8 players, graded against the 8-max tournament ranges (chip EV, 1bb big-blind ante, 10–300bb). ICM is not modelled.
PotsRaised pots that reach the flop heads-up. Preflop decisions are graded in every hand that isn't skipped.
SitesPokerStars, GGPoker, Winamax, WPN/ACR, 888poker, partypoker, iPoker, CoinPoker, DriveHUD XML

A hand is skipped whole, with a reason, when:

  • someone limps preflop (limped_pot);
  • three or more players see the flop (multiway_pot);
  • it has a straddle or posted blinds (antes_or_posts); antes are fine;
  • it doesn't replay legally from the text (replay_mismatch).

Preflop

Each preflop action reads the solved node it was taken at. Raise sizes snap to the nearest size the solver uses. An action the tree has no branch for, such as a cold call where the tree only folds or 3-bets, snaps to the nearest kind it does have. Each preflop decision returns the rangesLine it read, plus snapped: true when an earlier action had to change kind to fit the tree.

An action the solver never takes with that hand has no EV to measure. It is graded with evEstimated: true and no evLossBb or evLossPot. A missing loss here means unmeasured, not 0.

Flop, turn and river

A flop we have already solved grades at once. Any other flop is solved exactly for the hand: both players' preflop ranges walked through the line they played, the pot and stack at the flop, and the dealt flop.

The solve's tree has the standard bet size plus the hand's own first flop bet, rounded to 5% of the pot, at the node where it was made. A 66% lead is solved as 65% beside the standard 75%, so that bet and every decision after it are graded on the size actually played. Tournament flops always use 75% as the standard size, because the smaller tree needs too much memory for the wide ranges of short-stack spots. Later bets and raises use the tree's sizes: the actions labels show the tree's amounts, while toCallBb and potBb show the hand's real ones.

Turns and rivers are re-solved from the flop solve's ranges.

Request

POST/api/v1/grade/hands

Grade every hero decision in raw hand-history text (no-limit hold'em, heads-up raised pots, cash 2-6 players and tournaments 2-8 players). Preflop decisions grade from the solved ranges; flops not yet solved are solved exactly for the hand, with the hand's own first flop bet in the tree. A solve still running when solveWaitSeconds runs out returns solve_pending; resend to read it. Enterprise keys only.

Requestbash
curl "https://pokerdata.io/api/v1/grade/hands" \
  -H "Authorization: Bearer pdk_YOUR_KEY"
FieldTypeDefaultMeaning
textstringrequiredHand-history text: one or many hands, any supported site format. 2 MB max.
herostringthe "Dealt to" playerPlayer name to grade.
accuracyfast | standard | precisestandardExploitability target for new flop solves: 2%, 1% or 0.5% of the pot. fast also solves tournament flops on a smaller tree (see Accuracy and response times). Stored solves answer at their own accuracy. A stored solve at the same or a tighter target answers a looser request.
solveWaitSeconds0–30030How long the whole request may wait on live solves. The response arrives within about this time.
maxFlopSolves0–208New exact flop solves this request may start. Flops already in the store don't count.
maxHands1–10025Hands to grade. Hands beyond this are counted in summary.handsNotSent.
includearray["ranges", "strategy", "classes", "equity"]Study data to attach to each decision. Add "combos" for per-combo reach, mix and EVs (much larger). Send [] for grades only. Tournament hands carry no study data yet.
curl https://pokerdata.io/api/v1/grade/hands \
  -H "Authorization: Bearer $POKERDATA_API_KEY" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --rawfile text session.txt '{text: $text, accuracy: "standard", solveWaitSeconds: 120, include: []}')"

Response

{
  "format": "pokerstars-tournament",
  "hero": "Hero",
  "accuracy": { "level": "fast", "targetExploitabilityPct": 2 },
  "summary": {
    "handsInText": 1, "handsParsed": 1, "handsGraded": 1, "handsSkipped": 0, "handsNotSent": 0,
    "parseErrors": 0, "decisions": 3, "decisionsGraded": 3,
    "evLossBb": 0, "notGraded": {},
    "exactFlopSolves": 1, "exactFlopSolvesPending": 0
  },
  "hands": [
    {
      "handId": "900000000001", "site": "pokerstars", "status": "graded",
      "position": "HJ", "heroCards": ["Ac", "5c"], "board": ["3s", "9d", "8d"], "stackBb": 20.4,
      "evLossBb": 0, "offStrategyAt": null,
      "decisions": [
        {
          "street": "flop", "position": "HJ", "action": { "type": "fold" },
          "board": ["3s", "9d", "8d"], "potBb": 16.5, "toCallBb": 6.6,
          "status": "graded", "evLossBb": 0, "evLossPot": 0,
          "bestAction": "Fold 100%",
          "actions": [
            { "label": "Fold", "freq": 0.9993, "chosen": true },
            { "label": "Call 6.5bb", "freq": 0.0002, "lossBb": 0.41 },
            { "label": "All-in", "freq": 0.0005, "lossBb": 1.2 }
          ],
          "gradedBy": "exact_flop_solve", "solveAccuracy": "fast"
        }
      ]
    }
  ],
  "parseErrors": []
}

Decision fields

FieldMeaning
street, position, boardWhere the decision was made.
actionWhat the hero did: type (fold, check, call, bet, raise, all_in) and toBb (raise-to total) for bets and raises.
potBb, toCallBbThe pot before the hero acted, and the amount to call, from the hand itself.
statusgraded, or not_gradeable with a reason and message.
evLossBbBig blinds given up against the best action, including for an action the solver mixes in.
evLossPotevLossBb as a share of the pot the decision was made in (0–1).
bestActionThe solver's play with this hand, e.g. "Call 88%, All-in 12%".
actionsEvery action at the node: freq for the hero's hand, evBb and lossBb where priced, chosen on the hero's action.
gradedBypreflop_ranges, stored_flop, exact_flop_solve, nearest_flop or street_solve.
solveAccuracyThe accuracy tier of the solve that answered a flop.
solvedBoard, exactSolvePresent when a flop graded from the nearest solved flop while its exact solve runs ("pending") or can't run ("unavailable").
rangesLine, snapped, evEstimatedPreflop only; see Preflop.
contextThe study data asked for in include.

EV loss

The API reports how much EV each decision gave up and leaves the thresholds to you. evLossBb is the EV given up against the best action, in big blinds. evLossPot is the same loss as a share of the pot the decision was made in. An action the solver mixes in is charged its own EV loss like any other. At equilibrium, actions in a real mix have almost the same EV, so their loss is close to 0. A line the solver only plays now and then, at a real cost, shows that cost.

The two fields read differently by pot size. A 0.3bb loss is 12% of a 2.5bb preflop pot and under 1% of a 40bb turn pot. Many clients flag a decision on either one: a share of the pot for small pots and a bb amount for big ones. Every action's lossBb is in actions, so you can also grade against the second-best action or a mix.

Each hand also carries evLossBb, the sum over its graded decisions, and summary.evLossBb sums the whole request.

Off-strategy actions

Grading stops at the first hero action the solver plays less than 1% of the time with the hero's hand. This includes a preflop action the solver never takes (evEstimated: true). The solver never reaches the spots after it, so its ranges say nothing about how to play them. The hand's offStrategyAt gives that decision's index in decisions and its street, or null. Every later decision comes back not_gradeable with reason after_off_strategy. A costly action the solver still plays 1% of the time or more doesn't stop grading: its loss shows in evLossBb.

Not graded

reasonMeaning
solve_pendingThe solve is still running when the request's wait ran out. It keeps running and is cached, so send the same hands again to get the grade.
off_tree_preflopThe solved preflop tree has no action of that kind at this point.
multiway_potMore than two players in the pot postflop.
no_solveNo solve covers this spot. The message says why.
after_off_strategyAn earlier hero action left the solver's strategy; see Off-strategy actions.

Accuracy and response times

Preflop decisions, and flops already in the store, are graded in well under a second at any accuracy. A flop nobody has asked for yet is solved on demand. On one solver, 100bb single-raised pots take:

LevelTargetMonotone flopPaired flopDry flop
fast2% of pot~25 s~50 s~90 s
standard1% of pot~40 s~80 s~140 s
precise0.5% of pot~55 s~110 s~205 s

At fast, tournament flops solve on a smaller tree, about 2× faster overall and 3–4× on deep stacks. The tree keeps every action in the hand and every option at the hero's own decisions. It removes the villain's all-ins on streets where the villain didn't shove, the flop lead of a villain who called preflop and didn't lead, and river raises the hand didn't make. All-ins stay everywhere under 25bb or when the flop stack-to-pot ratio is under 4. On 56 benchmark decisions, EV loss stayed within 0.1bb of the full tree on 45, and within 0.53bb on all of them. standard and precise use the full tree.

Adding the hand's own bet size makes a solve about 1.35–1.6× slower. Short-stack tournament flops (15–40bb) solve in a few seconds to about a minute. Turn and river re-solves take about a second each.

A solve still running when solveWaitSeconds runs out comes back solve_pending and keeps running. Send the same request again to read the finished grade from the cache. Resending never starts a duplicate solve.

Limits and capacity

LimitValue
Hands per request100 (maxHands, default 25)
New flop solves per request20 (maxFlopSolves, default 8)
Body size2 MB
Longest wait per request300 s (solveWaitSeconds)

Capacity is shared across all customers. It is currently about 130 new flop solves an hour, roughly 750 hands an hour for a typical session where about one hand in six reaches a heads-up flop we haven't solved yet. Capacity is being raised to about 800 solves an hour. When every solver is busy, new solves queue rather than fail, and cached spots stay instant.

Each request counts once against your plan's request and data allowances, and the usage headers are on every response.

Errors

StatuscodeMeaning
400The body is not valid JSON, or a field is out of range. error names the field.
403enterprise_requiredThe key's plan is not Enterprise.
413The body is over 2 MB.
422No supported hand-history format was found in text.
503engine_unavailableThe grading service is unavailable. Retry later.