Betfair's official Historical Data service is the primary source — it sells recorded exchange price streams from 2016 onwards in BASIC (free), ADVANCED and PRO tiers. The data arrives as compressed stream files you must parse into prices over time. Free and third-party options exist for casual use, but for serious backtesting the official ADVANCED or PRO feed is the only complete record of how prices actually moved.
This page contains affiliate links — if you open an account through them we may earn a commission at no cost to you. It never changes our verdict.
- Why you need historical data
- The official Betfair Historical Data service
- BASIC, ADVANCED and PRO: what each gives you
- Free and third-party sources
- What the files actually look like
- Turning raw files into usable data
- From the desk: backtesting a drift signal
- Pitfalls that ruin a backtest
- How much data do you actually need?
- The verdict
- FAQ
This page is a sub of our data and analytics pillar, and it tackles the first practical wall every aspiring quant hits: getting the actual prices. You can theorise about a strategy all day, but until you've replayed it against real recorded market movement, you don't know whether it has an edge or whether you've just told yourself a nice story. Betfair, to its credit, sells the real recorded data — the catch is that it doesn't come in a form anyone can just open in Excel and read.
Why you need historical data
Backtesting is the difference between a hunch and an evidenced edge. A claim like “well-backed favourites tend to drift slightly in the final ten minutes before the off” is testable — but only if you have the prices for thousands of races at minute-by-minute resolution. Live observation gives you a few dozen data points and a strong dose of confirmation bias; historical data gives you thousands and the chance to be proven wrong, which is the whole point. Good data lets you measure the size of an edge, the variance around it, how often it fails, and what commission and realistic fills do to it. Without it you're trading on vibes, and the exchange is unusually efficient at removing money from people trading on vibes. The corollary is that bad or incomplete data is almost worse than none, because it gives you false confidence — which is why where you get the data, and how complete it is, matters enormously.
The official Betfair Historical Data service
The authoritative source is Betfair's own Historical Data service, hosted at historicdata.betfair.com and accessible with your Betfair account. It contains recorded exchange data from 2016 onwards across the major sports — horse racing, football, tennis, greyhounds and more — organised by sport, market type and date. Crucially, this is a recording of the actual data feed: the same market-change messages the live API streams, captured and stored. That means it reflects the real price ladder and, in the higher tiers, the real traded volumes, rather than some summarised end-of-event snapshot. You buy it per month of data, per sport, and download compressed archives. Because it's the genuine feed replayed, it's the only source that lets you reconstruct exactly what a trader would have seen tick by tick — which is precisely what a credible backtest requires.
BASIC, ADVANCED and PRO: what each gives you
The service comes in three tiers and the differences decide what you can actually test. BASIC is free and limited — it gives you market definitions and final results with a coarse view of prices, enough to learn the file format and do simple outcome studies, but not enough to model a trading strategy that depends on the moving ladder. ADVANCED adds the price data you need: best available back and lay prices over time, so you can see how the market moved and model entries and exits at prices that genuinely existed. PRO goes further again, adding full ladder depth and traded volume — every price that traded and how much — which is what you want if your strategy cares about liquidity, queue position, or how much you could realistically have got matched. As a rule: BASIC to learn the format, ADVANCED for most trading backtests, PRO if liquidity and fill realism are central to your edge. Pricing is monthly per sport, so a focused study of one sport over a defined period is far cheaper than hoovering up everything.
Free and third-party sources
Before you pay, know the free routes and their limits. Betfair publishes sample datasets for each tier — a handful of markets you can download for nothing, which is the right way to learn the parsing before you spend anything. The BASIC tier itself is free and fine for results-based studies. Beyond Betfair, a few third-party datasets and academic archives circulate, and there are community projects that share parsed samples; quality and completeness vary wildly, and licensing is often murky, so treat them as a way to experiment rather than a foundation for real money. The other “free” option is to record your own live data going forward via the Betfair API — you set up a stream listener, capture markets you care about, and build your own archive over weeks and months. That costs you time rather than money and gives you exactly the markets you want, but obviously can't give you the past. For anything historical and serious, the official ADVANCED or PRO feed remains the only complete answer.
What the files actually look like
This is where most people stall, so let's be concrete. A Betfair historical file is not a CSV of prices. It's a compressed archive (typically a .tar of .bz2 files) and inside each is a stream of JSON market-change messages — one line per change. Each message says, in effect, “at this timestamp, on this market, the back price on selection X is now this, the available amount is now that, the last traded price moved to this.” In other words it's a diff stream: it tells you what changed, not the full state each time. To know the complete ladder at any given second, you have to start from the market definition and apply every change message in order, maintaining the current state as you go. That's a different mental model from a spreadsheet, and it's the single biggest reason people give up — they open the file expecting rows of prices and find a wall of incremental JSON.
Turning raw files into usable data
The workflow is always the same shape. Decompress the archive, then read each market file line by line, parsing the JSON. Maintain state: hold the current best back, best lay and last traded price for each selection, updating them as each change message arrives, and stamp each state with its timestamp. Sample or snapshot to the resolution you need — for most trading studies a snapshot every second, or even every five seconds, around the period you care about is plenty, and far easier to work with than every micro-change. Then flatten the result into a tidy table: one row per selection per timestamp, with the columns you'll analyse. Betfair publishes example parsers, and the community has built libraries — the Python data analysis tutorial walks through doing exactly this with pandas, and the API with Python guide covers the same message format from the live side. Once you have that tidy table, the hard part is done and the actual strategy logic is comparatively easy.
The question: I'd noticed anecdotally that some heavily backed UK favourites drift a tick or two in the final five minutes before the off as the early money gets countered. Worth a strategy, or just memory playing tricks?
The data: I bought one month of ADVANCED horse racing data for UK win markets — a few hundred races — and parsed it to a one-second snapshot of best back and best lay for the favourite in each race over the final ten minutes.
The test: for each race I recorded the favourite's best back price at five minutes out and at the off, then simulated laying £50 at the 5-minute price and backing it level at the off price if it had drifted. Example race: lay £50 at 3.45, back £50.74 at 3.40 at the off — a small green of about £0.70 before commission.
The result: across the sample the favourite drifted more often than it shortened in that window, but the average move was tiny and roughly a third of races went the other way. After 2% commission, the modelled edge was real but thin — the kind of thing that only pays with discipline, volume and zero execution slippage, and would be eaten alive by a few bad fills.
The lesson: the data turned a vague “I think favourites drift” into a measured “they drift slightly, about 60% of the time, for an average move too small to be a reliable standalone edge.” That's exactly what historical data is for — not to confirm your hunch, but to size it honestly. I'd never have known the edge was this marginal from watching races.
Pitfalls that ruin a backtest
A few mistakes turn a backtest into self-deception. Assuming perfect fills is the worst: in the data you can “match” at any price you see, but live you have to queue, and in a thin market you might not get matched at all — always model realistic liquidity, which is why PRO's traded-volume data matters for serious work. Ignoring commission flatters every result; a thin edge often vanishes once you subtract 2–5%. Over-fitting is the seductive one: if you tweak entry and exit rules until the past looks perfect, you've fitted noise, not signal, and it won't survive live — keep rules simple and test them on a period you didn't tune them on. Look-ahead bias sneaks in when your logic accidentally uses information that wasn't available at the moment of the trade. And survivorship and sample-size problems mean a month of data and forty trades prove very little. Treat a backtest as evidence to be argued with, not a green light — the market that generated the data is also the market that will happily punish overconfidence.
How much data do you actually need?
A mistake almost everyone makes is buying too much data and then drowning in it. The instinct is “more is better — give me every sport, every month, going back to 2016”, and the result is hundreds of gigabytes of compressed streams you'll never parse and a bill you didn't need to pay. The right question is narrower: what is the smallest dataset that can answer my specific question? If you're testing a pre-race drift signal on UK win markets, you need UK racing win markets for a representative period — and a couple of months across different parts of the season is usually enough to see whether an effect is real and roughly how big, before you spend more confirming it. Buying one focused sport for a defined window is cheap; hoovering up everything is expensive and slows every parse you run. The other dimension is resolution: you rarely need every micro-tick. For most trading studies, a one-second snapshot is finer than you'll actually use, and for slower signals a five-second snapshot makes files dramatically smaller and analysis faster with no real loss. There's also a sensible workflow: prototype on free samples to get your parser and logic working, buy a small focused slice to get a first read on the edge, and only scale up the date range or sports if the early read justifies the spend. That staged approach keeps costs down and, more importantly, keeps you from confusing “I have lots of data” with “I've learned something” — they're not the same, and a tightly scoped study on two months of one market will teach you more than a terabyte you never finish parsing.
The verdict
If you're serious about testing a Betfair strategy, the official Historical Data service is where to start — BASIC and the free samples to learn the format, ADVANCED for most trading backtests, PRO when liquidity and fills are central. The data is genuine and complete from 2016, which is more than most markets give you. The real work isn't buying it; it's parsing the stream into something tidy and then resisting the urge to over-fit. Build your own live archive via the API alongside it, lean on the Python workflow, and anchor everything in the data and analytics pillar. Get the data right and you can finally trade on evidence instead of memory — just remember that a backtest measures the past, and the market only ever pays you in the present.
FAQ
Where can I download Betfair historical data?
From Betfair's official Historical Data service (historicdata.betfair.com), which sells recorded exchange data from 2016 onward in three tiers. There are also free sample files and a handful of third-party datasets, but the official service is the complete, authoritative source.
Is Betfair historical data free?
Partly. Betfair offers a free BASIC tier with limited fields and samples, which is enough to learn the format. The ADVANCED and PRO tiers, which include the full price ladder and traded volumes needed for serious backtesting, are paid and priced per month of data per sport.
What format is Betfair historical data in?
It's delivered as compressed files containing a stream of market change messages — essentially a replay of the exchange data feed, not a tidy spreadsheet. You parse those messages to reconstruct the price ladder and traded volume at each moment in time.
How do I backtest a strategy with Betfair data?
Parse the stream files into a time series of prices and volumes, then replay them in order, applying your entry and exit rules as if live and recording the fills you'd have got. The key is to model only the prices and liquidity that actually existed, including commission and realistic matching.
Can I get pre-2016 Betfair data?
Officially no — Betfair's service starts in 2016. Some older datasets circulate via third parties and academic archives, but coverage is patchy and quality varies, so treat pre-2016 data with caution for any serious analysis.
Related reading
This is a sub of our Betfair data and analytics pillar. Pair it with the best data sources and APIs roundup and the hands-on Python data analysis tutorial. To collect your own live data instead of buying it, see the Betfair API guide, the API with Python walkthrough and our guide to building Betfair bots. Then apply what you learn to pre-race and swing trading.
A backtest that looks profitable is not a guarantee — historical fills, liquidity and your own discipline differ from live trading, and over-fitting to past data is the single most common way to fool yourself. Most Betfair traders lose money overall; past results don't guarantee future returns. 18+ only; help at BeGambleAware.org.
Tested an edge in the data and ready to trade it live? Size your stakes and green-up targets with the calculator before you risk real money.
Open the Calculator Open Betfair Account →