{
  "id": 5816879,
  "title": "Tennis, football and basketball results as clean JSON, without a sports data contract",
  "url": "https://urgent.news/2026/09/05/tennis-football-and-basketball-results-as-clean-json-without-a-sports",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-05T19:10:43.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/clearfetch/tennis-football-and-basketball-results-as-clean-json-without-a-sports-data-contract-3b19"
  },
  "original_language": "en",
  "account": "Sports data is often inaccessible due to high costs, requiring expensive contracts or custom scrapers. However, there is a middle ground for building models, scoreboards, or fantasy tools. This article explores the nuances of sports data that many scrapers overlook.\n\nMost scrapers inaccurately categorize match statuses as either upcoming, live, or finished. In reality, matches can be retired mid-set, abandoned at halftime, replayed, awarded, or decided by penalties. These scenarios require different treatments when building models. The author discovered this firsthand when their tennis scraper mislabeled live matches as cancelled, leading to seven incorrect labels on one day's worth of data.\n\nWhen inferring data from samples, it's crucial to establish the correct mapping. In the case of tennis, codes 17 and 18 actually represent ongoing matches, not postponed or cancelled ones. The author's scraper was erroneously reporting live matches as cancelled, with instances of partially completed matches displaying as having no result.\n\nScores are not simply two integers. Tennis requires set scores and tiebreak points. A set ending 7-6 must consider the 7-4 tiebreak score, and a match at 6-6 in the first set must incorporate the live tiebreak count. A similar approach applies to basketball, which involves quarters and overtime periods. Ensuring these components add up correctly verifies the accuracy of your data mapping.\n\nFootball requires additional complexity with halves, extra time, and shootouts. A match ending 0-0, won 4-3 on penalties, might display as 1-0 due to the shootout points being absorbed into the final score. Deriving the first-half score from the total can lead to inaccurate results, particularly in shootout scenarios. It's better to leave these fields null rather than publishing incorrect data.\n\nThe author built three tailored scrapers for tennis, football, and basketball, each costing just $0.001 per match. One complete day of world football matches costs under $2, providing detailed information such as goals, assists, cards, substitutions, expected goals, and more. Importantly, every unmapped field remains preserved in the raw object, allowing for future expansion if needed. This approach ensures accurate and comprehensive sports data without relying on expensive contracts or intricate scraping techniques.",
  "summary": "Sports data is one of those areas where the gap between \"public information\" and \"affordable to obtain\" is absurd. Scores and results are facts, printed in every newspaper. Getting them as structured data usually means either a five-figure contract with a rights holder, or writing your own scraper and maintaining it forever. If you are building a model, a scoreboard or a fantasy tool rather than…",
  "key_points": [
    "Tennis matches can retire mid-set or be replayed, requiring unique data treatment",
    "Codes 17 and 18 in tennis data represent ongoing matches, not cancelled ones",
    "Football scores include additional complexities like penalties and shootouts"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}