Sports Odds Data Feeds: XML vs JSON and What a Betting Data Feed Contains

What a sports odds data feed is, how XML and JSON odds feeds differ, how feeds are delivered (pull, push and webhooks), what a betting data feed should contain, and where sports odds history fits. PreciseAPI's feed is JSON only, and this post says so plainly.

By PreciseAPI Engineering

Published

"Odds feed" is an older term than "odds API", and the two get used for the same thing: a sports odds data feed is a machine-readable stream of the prices that sportsbooks, exchanges and other sources post, delivered to your systems on a schedule or as they change. Searches for a sports odds XML feed usually come from teams whose systems were built around XML, or who found XML feeds in older documentation and want to know whether that is still the norm.

This post covers what a betting data feed contains, how XML and JSON odds feeds compare, the ways a feed can be delivered, and where sports odds history fits. One fact up front, so nobody has to hunt for it: the PreciseAPI feed is JSON only, over REST and a WebSocket stream. It does not offer XML. If your stack requires XML, the conversion section below shows how small that step is, and the comparison pages name providers that publish XML themselves.

What a sportsbook data feed contains

Whatever the format, a useful odds data feed carries the same layers. If one is missing, you end up building it yourself.

In the PreciseAPI feed those layers map to /v1/odds and /v1/events/{id}/odds for prices, /v1/events for the schedule, /v1/scores for scores and results, and the free /v1/leagues, /v1/sportsbooks and /v1/markets for reference data. Prices come from 36 sources across 17 leagues: 23 sportsbooks, 7 exchanges and 6 DFS pick'em apps, all on shared event, market and selection ids. The data model docs describe every object.

Bookmaker data feed vs aggregated odds feed

A bookmaker data feed and an aggregated odds feed are different products that get called by the same names.

A bookmaker data feed is sold to operators. It is the pricing a sportsbook runs on: odds, often with settlement, results and trading tools attached, so a book can offer markets without employing its own traders. Those feeds tend to be enterprise contracts, and many of the long-established ones use XML.

An aggregated odds feed collects the prices that many books are already posting and puts them in one schema, so you can compare them. That is what odds screens, models, alert services, media sites and DFS tools need, and it is what PreciseAPI supplies. It is a data provider: it does not take bets, set prices for anyone or publish picks. The post on how sportsbooks get odds covers where the operator-side feeds fit in the market.

XML vs JSON odds feeds

Both formats can carry the same data. The differences are in tooling, size and how well each fits a stream of small changes.

XML odds feedJSON odds feed
Typical homeOlder enterprise and operator feedsModern REST APIs and WebSocket streams
ParsingXML parser, often with an XSD schemaBuilt into every language; native in JavaScript
SizeOpening and closing tags add bulkSmaller for the same data
TypesEverything is text unless a schema says otherwiseNumbers, booleans and null are native
ArraysRepeated elements; one item can look like a single childExplicit arrays
Streaming deltasPossible, usually over a message queueA natural fit for WebSocket messages
ValidationStrong, with XSDJSON Schema or OpenAPI

XML's real advantage is formal validation. An XSD can say exactly what a valid message looks like, and some older systems were built to reject anything that doesn't match. Its disadvantages show up in odds data specifically: a board of thousands of markets carries a lot of tag overhead, and a price of -110 arrives as text that every consumer has to convert.

JSON fits the way odds change. A live board is a large snapshot followed by many tiny updates, and a JSON object per changed market is small and quick to parse in a browser or a Node.js service. That is why most newer odds APIs, PreciseAPI included, settled on JSON over REST plus a WebSocket stream. JSON gets validation too: PreciseAPI publishes an OpenAPI 3.1 spec that describes every response, and code generators turn it into typed clients.

Which providers publish XML

According to their own documentation, as summarized on our comparison pages, Sportradar and SportsDataIO serve JSON or XML, and OpticOdds lists XML among its delivery options. If XML from the provider is a hard requirement, those pages are a fair place to start, and the comparison hub sets the options side by side.

Getting XML out of a JSON odds feed

If the requirement is an XML file for a downstream system rather than XML from the provider, conversion is a short step in your own code. This pulls NFL game lines from the JSON feed and writes one XML document:

import os
import requests
import xml.etree.ElementTree as ET

res = requests.get(
    "https://api.preciseapi.com/v1/odds",
    params={"league": "nfl", "markets": "moneyline,spread,total", "books": "pinnacle,draftkings,fanduel"},
    headers={"Authorization": f"Bearer {os.environ['PRECISEAPI_KEY']}"},
    timeout=15,
)
res.raise_for_status()
body = res.json()

root = ET.Element("odds", league="nfl", generated=body["meta"]["generated_at"])
for event in body["data"]:
    ev = ET.SubElement(root, "event", id=event["id"], start=event["start_time"], status=event["status"],
                       home=event["home"]["name"], away=event["away"]["name"])
    for book in event["bookmakers"]:
        bk = ET.SubElement(ev, "book", id=book["id"])
        for m in book["markets"]:
            mk = ET.SubElement(bk, "market", id=m["id"], key=m["key"], period=m["period"],
                               suspended=str(m["suspended"]).lower(), updated=m["updated_at"])
            for o in m["outcomes"]:
                ET.SubElement(mk, "outcome", id=o["id"], side=o["side"], price=str(o["price"]),
                              point="" if o.get("point") is None else str(o["point"]))

ET.ElementTree(root).write("nfl_odds.xml", encoding="utf-8", xml_declaration=True)

That call costs 2 credits however many books it returns. Keep the ids as attributes when you convert: they are what lets the XML consumer join one book's price to the same outcome at another book.

How odds feeds are delivered

Format is one choice; delivery is the other. An odds feed API usually offers one or more of three patterns.

Pull (REST). Your code asks on a schedule and gets the current state. It is simple, works on every PreciseAPI plan, and suits pre-game screens, spreadsheets, content and models. Freshness is as good as your polling interval.

Push (stream). You hold one connection open and the provider sends changes. On PreciseAPI that is the WebSocket stream at /v1/stream: subscribe to leagues or events, receive a snapshot in the same shape as /v1/odds, then deltas with only the changed markets, each numbered so you can detect a gap and resync. The stream and live in-play odds are on the Syndicate plan.

Push on a condition (webhooks). The provider calls your server when something specific happens. PreciseAPI's alert rules send a signed line.moved webhook when a main-market price or line moves past your threshold.

Some providers also deliver over message queues or Server-Sent Events; PreciseAPI doesn't. The polling vs WebSockets post covers the trade-offs in depth, and the what is an odds API primer shows a full response.

Sports betting feeds and freshness

A sports betting data feed is only as good as its handling of prices that have gone away. Books suspend markets during play and pull them when news breaks, and a feed that keeps serving the last price makes everything downstream wrong.

Each PreciseAPI market carries suspended, updated_at and source-side clocks such as source_observed_at, and suspended markets are left out of responses unless you pass include_suspended=true. max_source_age_ms drops any quote the source hasn't confirmed within that window. /v1/status is free and reports each source as operational, suspended or no_data, so a book that stops sending is visible rather than silent.

Sports odds history in a feed

A feed shows the current price; history shows how it got there. PreciseAPI's /v1/history returns the opening price, the current price and every recorded move for one book's main full-game moneyline, spread or total, at 3 credits a call on paid plans. It covers markets on the board and games that finished recently: history stays readable for 48 hours after a market's last change.

It is not a multi-season archive, and there is no bulk download. Teams that want long-run sports odds history from the feed store it as games approach and finish. The historical odds API page shows a collector script, and the football betting data post designs a database around it.

Choosing an odds data feed

When comparing sportsbook data feeds, check these in order:

  1. Coverage. The books, leagues, markets and periods you need. The coverage page lists ours.
  2. Format and delivery. JSON or XML, and REST, stream, webhooks or queues. Match what your systems already handle.
  3. Ids. Shared event, market and selection ids across books, or name matching left to you.
  4. Freshness signals. Suspension flags, timestamps and source health.
  5. History. Recorded moves, interval snapshots or none, and how far back.
  6. Cost model. Per request, per market or flat, measured against how you will call it.

The buyer's checklist expands each point. On PreciseAPI, the free Sandbox gives 50 one-time credits and a free key for pre-game odds; Edge is $49.99 a month for 100,000 credits with props, futures and history; Sharp ($199.99) and Syndicate ($249.99) are unlimited, and Syndicate adds in-play odds and the stream. See pricing.

Frequently asked questions

Does PreciseAPI offer a sports odds XML feed?

No. Every PreciseAPI response is JSON, over REST or the WebSocket stream. If a downstream system needs XML, convert the JSON in your own code, as in the example above, keeping the event, market and selection ids.

What is the difference between an odds feed API and an odds API?

Mostly the name. "Feed" is the older term and often implies push delivery or a file format such as XML; "API" usually means REST endpoints, often with a stream alongside. Both deliver the same thing: structured prices from many sources.

Are JSON odds feeds better than XML?

For most new projects, yes: JSON is smaller, typed and native to web and Node.js tooling, and it suits streams of small updates. XML still makes sense where existing systems validate against an XSD and expect it.

Can I get sports odds history from a data feed?

From PreciseAPI, line history covers the main full-game markets for games on the board and markets that changed in the last 48 hours. For long-run history you store it yourself as games are played, or buy an archive from a provider that keeps one.

Is a betting data feed the same as a sportsbook?

No. A data feed supplies prices. PreciseAPI doesn't accept bets, hold funds or give picks; bets are placed at a sportsbook or exchange.

Keep reading