Menu

Parsing PokerStars and GGPoker hand histories in TypeScript, entirely client side
📰

Parsing PokerStars and GGPoker hand histories in TypeScript, entirely client side

DEV Community: webdev·3BetLab·about 1 month ago
#I5tSxiyJ
#devtowebdev#devto#dev#hand#first
Long article (386 words) — no AI summary yet.
Reading 0:00
15s threshold

I run a poker trainer, and the most requested feature was "show me my mistakes in real games". That means reading hand history files, the plain text logs poker sites write for every hand. I wanted to do it without uploading anyone's files, so everything below runs in the browser.

What a hand history looks like

Each hand is a block of text: a header with the hand id, stakes and date, the seats with stacks, then actions street by street, then the summary. PokerStars and GGPoker are close, but not identical. GGPoker hides opponents' cards unless they reach showdown, tournament headers carry the level and ante, and some rooms post a big blind ante as a single line.

The approach that worked

Split the file into hands by the header line, not by blank lines. The header is the one thing every hand reliably starts with.

Parse seats first and build a map from player name to seat.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.