MLB prediction engine powered by logistic regression, Elo ratings, and Claude AI. Programmatic access to predictions, rankings, value bets, and model accuracy.
All endpoints require an API key. Pass it as a query parameter or header:
GET https://diamond.champlinenterprises.com/api/v1/predictions.php?date=2026-04-06&api_key=YOUR_KEY
curl -H "X-Api-Key: YOUR_KEY" https://diamond.champlinenterprises.com/api/v1/predictions.php?date=2026-04-06
| Tier | Daily Limit | Use Case |
|---|---|---|
| Free | 100 requests | Personal projects, evaluation |
| Pro | 1,000 requests | Apps, bots, dashboards |
| Enterprise | Unlimited | Commercial, high-volume |
Free tier issues instantly — no credit card. Sign up here (60 seconds).
Need higher limits? See pricing for Pro and Enterprise tiers.
Code samples and OpenAPI 3.1 spec on GitHub: Kevinchamplin/diamond-api-examples
Get all predictions for a specific date. Includes Claude AI analysis, model probabilities, confidence scores, value edges, and reasoning.
| Name | Type | Description | |
|---|---|---|---|
date |
string | optional | ISO 8601 date (YYYY-MM-DD). Defaults to today. |
api_key |
string | required | Your API key. |
{
"date": "2026-04-06",
"model_version": "1.0",
"count": 13,
"predictions": [
{
"game_id": 352,
"home_team": "COL",
"away_team": "HOU",
"predicted_winner": "HOU",
"predicted_home_score": 5,
"predicted_away_score": 8,
"confidence": 64,
"confidence_level": "medium",
"model_probability": 0.677,
"vegas_probability": 0.648,
"consensus_probability": 0.662,
"value_edge": 5.5,
"reasoning": "Houston's rotation advantage...",
"key_factors": ["Elo gap: +85 HOU", "Coors Field effect"]
}
]
}
Get a raw statistical model prediction for any matchup. Uses current Elo ratings and logistic regression. No Claude AI, pure math. No game needs to exist in the database.
| Name | Type | Description | |
|---|---|---|---|
home |
string | required | Home team abbreviation (e.g., NYY, LAD, CHC) |
away |
string | required | Away team abbreviation |
season |
int | optional | Season year. Defaults to current year. |
{
"matchup": {
"home": {
"abbreviation": "NYY",
"name": "New York Yankees",
"elo": 1567.3,
"momentum": 12.4
},
"away": {
"abbreviation": "BOS",
"name": "Boston Red Sox",
"elo": 1523.1,
"momentum": -3.2
}
},
"prediction": {
"predicted_winner": "NYY",
"home_win_probability": 0.5892,
"away_win_probability": 0.4108,
"confidence": 58.9
},
"features": {
"elo_diff": 68.2,
"pitcher_diff": 0.0,
"park_adj": 0.049
}
}
All 30 MLB teams ranked by Elo rating. Includes peak/floor Elo, recent form (last 5), momentum (last 10 Elo delta), and tier classification.
| Name | Type | Description | |
|---|---|---|---|
season |
int | optional | Season year. Defaults to current year. |
| Tier | Elo Range |
|---|---|
elite | 1580+ |
contender | 1540-1579 |
above_average | 1500-1539 |
below_average | 1460-1499 |
rebuilding | 1420-1459 |
basement | <1420 |
{
"season": 2026,
"count": 30,
"baseline_elo": 1500,
"rankings": [
{
"rank": 1,
"team": "LAD",
"name": "Los Angeles Dodgers",
"elo": 1598.2,
"tier": "elite",
"momentum": 8.3,
"last_5": "4-1"
}
]
}
Games where Diamond AI's model probability diverges from Vegas lines. Sorted by edge size (best value first). Updated daily with new predictions.
| Name | Type | Description | |
|---|---|---|---|
date |
string | optional | ISO 8601 date. Defaults to today. |
min_edge |
float | optional | Minimum edge percentage to include (e.g., 5 for 5%+). |
| Rating | Edge |
|---|---|
strong | 10%+ |
moderate | 5-9.9% |
slight | 3-4.9% |
minimal | <3% |
{
"date": "2026-04-06",
"count": 5,
"value_bets": [
{
"game_id": 343,
"home_team": "CLE",
"away_team": "KC",
"model_home_probability": 0.638,
"vegas_home_probability": 0.520,
"value_side": "home",
"edge_pct": 11.8,
"rating": "strong"
}
],
"disclaimer": "For entertainment and informational purposes only."
}
Model performance metrics: overall accuracy, Brier score, calibration curve, performance by confidence level, and recent daily form. Compare against benchmarks (coin flip, Vegas consensus).
| Name | Type | Description | |
|---|---|---|---|
season |
int | optional | Season year. Defaults to current year. |
last |
int | optional | Get accuracy for last N predictions (1-500). |
| Metric | Description | Good Target |
|---|---|---|
accuracy_pct | % of winners picked correctly | >55% |
brier_score | Probability calibration (lower = better) | <0.24 |
score_rmse | Score prediction error | <3.0 |
run_line_accuracy_pct | Run line (spread) accuracy | >45% |
{
"season": 2026,
"overall": {
"total_predictions": 156,
"correct": 91,
"accuracy_pct": 58.3,
"brier_score": 0.2318
},
"calibration": [
{ "bucket": "55-59", "predictions": 42, "actual_win_pct": 54.8 },
{ "bucket": "60-64", "predictions": 38, "actual_win_pct": 63.2 }
],
"recent_form": [
{ "date": "2026-04-05", "games": 15, "correct": 10, "accuracy_pct": 66.7 }
],
"benchmarks": {
"coin_flip": 50.0,
"vegas_consensus": 56.0
}
}
Public health check (no API key required). Returns liveness, model freshness, last grading time, and last data sync timestamps. Designed for status pages and customer monitoring.
| Status | HTTP | Meaning |
|---|---|---|
ok | 200 | All checks passing. |
degraded | 200 | Service is up but one or more freshness checks are stale (e.g., model_weights > 14 days, Elo > 48h). |
critical | 503 | A required component is unreachable (database down, model_weights missing). |
{
"status": "ok",
"timestamp": "2026-05-08T11:00:27-05:00",
"api_version": "1.0",
"model": {
"version": "2.0",
"trained_at": "2026-05-03 05:00:35",
"training_games": 10616,
"test_accuracy": 57,
"test_brier": 0.2408
},
"checks": {
"model_weights": { "status": "ok", "age_days": 5.25 },
"grading": { "status": "ok", "age_hours": 11.3 },
"predictions": { "status": "ok", "age_hours": 2.9 },
"team_elo": { "status": "ok", "age_hours": 0 },
"database": { "status": "ok" }
},
"response_time_ms": 5.1
}
All errors return JSON with a consistent structure:
{
"error": true,
"code": "UNAUTHORIZED",
"message": "Invalid API key."
}
| Code | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad request (invalid parameters) |
| 401 | Unauthorized (missing or invalid API key) |
| 405 | Method not allowed (use GET) |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Every response includes rate limit headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 847
X-RateLimit-Reset: 1743998400
Limits reset daily at midnight Central Time. The X-RateLimit-Reset value is a Unix timestamp.
| Header | Description |
|---|---|
X-Model-Version | Current prediction model version |
X-API-Version | API version (1.0) |
X-RateLimit-Limit | Max requests per day for your tier |
X-RateLimit-Remaining | Requests remaining today |
X-RateLimit-Reset | Unix timestamp when limit resets |
Diamond AI commits to the following SLOs for the public API. They apply to /api/v1/predictions.php, /api/v1/accuracy.php, and the other v1 endpoints. Health checks at /api/v1/health.php are not subject to the latency SLO (they're meant to run faster — see below).
| Endpoint | p95 target | p99 target |
|---|---|---|
| Cached prediction reads (same date, repeated) | 200 ms | 500 ms |
| Uncached reads (cold cache, joins to games/teams) | 800 ms | 1500 ms |
/api/v1/health.php | 50 ms | 150 ms |
Latency is measured at the application boundary (after TLS termination), excluding network round-trip from your client.
99.5% monthly for v1 endpoints. That works out to roughly 3.6 hours of allowed downtime per month. Scheduled maintenance is excluded from this calculation.
Sundays, 4:00–6:00 AM Central Time. This is when Diamond's weekly model retraining and model-promotion job run. The API may briefly return cached or older model versions during this window. We'll announce any planned outage that exceeds 5 minutes via the /api/v1/health.php response (status: "degraded").
Documented separately above. Rate-limit responses (HTTP 429) do not count against the availability SLO.
Any of those tripping their thresholds emits a degraded status from /api/v1/health.php. If the database or model weights are unreachable, status becomes critical and the endpoint returns HTTP 503.
Real-time status: https://diamond.champlinenterprises.com/api/v1/health.php