Menu

RacingLLM B2B API Documentation v2.0

REST API for Hong Kong horse racing predictions, analysis, and AI commentary.

Overview

RacingLLM provides Hong Kong horse racing predictions, analysis, and AI-generated commentary via a REST API. All endpoints return JSON. Authentication is via Bearer token (API key).

Base URL: https://api.racingai.site/v1

Authentication

All B2B endpoints require an API key passed as a Bearer token:

curl -H "Authorization: Bearer sk-b2b-xxxxxxxx" \
  https://api.racingai.site/v1/b2b/races

API Key Tiers

TierRate Limit (per min)Monthly CallsOverage
Pro3010,000HK$0.10/call
Business12050,000HK$0.10/call
Enterprise300Unlimited

Error Responses

CodeMeaning
401Missing or malformed Authorization header
403Invalid, inactive, or expired API key
429Rate limit exceeded (per minute). Retry after 60s.
404Resource not found
500Internal server error
{"detail": "Invalid or inactive API key"}

Endpoints

GET/v1/b2b/racesList all available race dates
GET/v1/b2b/races/{'{date}'}List races by date
GET/v1/b2b/races/{'{date}/{venue}/{race_no}'}Full race detail
GET/v1/b2b/predictions/latestLatest predictions
GET/v1/b2b/stats/{'{season}'}Season statistics
GET/v1/b2b/commentary/{'{date}'}AI commentary articles

Race Detail Response

GET /v1/b2b/races/2026-06-10/HV/7

{
  "race_date": "2026-06-10",
  "venue": "HV",
  "race_no": 7,
  "distance": 1650,
  "race_name": "會員盃",
  "race_class": "C3",
  "track": "TURF",
  "going": "GOOD",
  "num_horses": 12,
  "horses": [
    {
      "horse_no": 1,
      "horse_name_ch": "金鎗六十",
      "draw": 5,
      "rating": 110,
      "win_odds": 3.5,
      "win_prob": 0.25,
      "place_prob": 0.65,
      "top4_prob": 0.85,
      "is_cold": false,
      "threat_score": 0.12,
      "threat_level": "low"
    }
  ],
  "top4_horses": [1, 3, 7, 5],
  "confidence": {
    "tier": "high",
    "model1_hn": 1,
    "market1_hn": 1,
    "agree": true
  }
}

Data Dictionary

Prediction Fields

FieldTypeDescription
win_probfloat (0-1)Model-estimated win probability
place_probfloat (0-1)Model-estimated place (top-3) probability
top4_probfloat (0-1)Model-estimated top-4 probability
is_coldboolTrue if horse is flagged as a cold/dark horse
threat_scorefloat (0-1)How threatening this cold horse is to favorites
threat_levelstringlow, medium, or high

Confidence Tiers

TierMeaning
highModel's #1 pick agrees with market favorite — high reliability
mediumSome alignment between model and market
lowModel and market disagree — higher uncertainty

Venues

CodeNameSurface
STSha Tin 沙田Turf & Dirt
HVHappy Valley 跑馬地Turf

Rate Limiting Headers

All B2B responses include rate limit information in headers:

X-RateLimit-Minute-Remaining: 29
X-RateLimit-Month-Remaining: 9847
X-RateLimit-Month-Overage: 0

Webhooks (Business tier+)

Available in a future release. Will push race results to your webhook URL within 5 minutes of official results.

Changelog

v2.0 (2026-06-11) — Initial B2B API release. Three pricing tiers: Pro, Business, Enterprise. Endpoints: races, predictions, stats, commentary. API key auth with per-minute and per-month rate limiting.

Contact: your email | API Status: GET /v1/health