/api/v1/health
Health check with database connectivity probe.
- Response fields:
status.
curl -s "https://www.ballparkpal.com/api/v1/health"
JSON API for Ballpark Pal data
https://www.ballparkpal.com/api/v1
Use www to avoid redirect behavior.
Append ?pretty to any GET request for browser-friendly JSON.
All /api/v1 endpoints require an API key except /api/v1/health.
Recommended: send the key in X-API-Key.
curl -s -H "X-API-Key: YOUR_API_KEY" "https://www.ballparkpal.com/api/v1/games?date=2026-04-01"
Alternative: pass the key as query parameter apiKey.
curl -s "https://www.ballparkpal.com/api/v1/games?date=2026-04-01&apiKey=YOUR_API_KEY"
Successful responses include a meta object and a data payload.
{
"meta": { "asOf": "2026-02-09T18:21:07Z", "requestId": "..." },
"data": ...
}
Errors are returned in a normalized error envelope.
{
"error": {
"code": "invalid_argument",
"message": "Invalid integer parameter: teamId",
"details": { "param": "teamId" },
"requestId": "..."
}
}
/api/v1/health
Health check with database connectivity probe.
status.curl -s "https://www.ballparkpal.com/api/v1/health"
/api/v1/markets
Lists active market definitions.
marketKey, marketType, subjectType, displayName, usesLine, status.curl -s -H "X-API-Key: YOUR_API_KEY" "https://www.ballparkpal.com/api/v1/markets"
/api/v1/teams
Lists teams.
teamId, abv, city, nickname.curl -s -H "X-API-Key: YOUR_API_KEY" "https://www.ballparkpal.com/api/v1/teams"
/api/v1/players
Lists players with optional filters.
teamId (optional integer)q (optional text; search on FullName)playerId, teamId, firstName, lastName, fullName.curl -s -H "X-API-Key: YOUR_API_KEY" "https://www.ballparkpal.com/api/v1/players?teamId=147&q=judge"
/api/v1/games
Lists games by date (preferred) or by gameId.
date=YYYY-MM-DD or gameId is required.gameId, gameDate, gameTime, teamAwayId, teamHomeId, venueId.curl -s -H "X-API-Key: YOUR_API_KEY" "https://www.ballparkpal.com/api/v1/games?date=2026-04-01"
/api/v1/games/{gameId}
Retrieves a single game by ID.
gameId, gameDate, gameTime, teamAwayId, teamHomeId, venueId.curl -s -H "X-API-Key: YOUR_API_KEY" "https://www.ballparkpal.com/api/v1/games/776345"
/api/v1/projections
Returns projections for a single game.
gameId is required.marketType, marketKey, displayName, line, side, odds, probability, average, subject (object: type, id), teamId (when applicable).average is the simulated average projection for the stat (e.g. projected hits, strikeouts). Null for probability-based markets like Moneyline and Pitcher Win.curl -s -H "X-API-Key: YOUR_API_KEY" "https://www.ballparkpal.com/api/v1/projections?gameId=776345"
/api/v1/parkfactors
Returns Ballpark Pal modeled park factors for every game on a given date.
date=YYYY-MM-DD is required.18 = 18%). Amount fields are decimals representing estimated stat changes.gameId, gameTime, teamAway, teamHome, runsPercent, homeRunsPercent, doublesTriplesPercent, singlesPercent, runsAmount, homeRunsAmount, doublesTriplesAmount, singlesAmount.curl -s -H "X-API-Key: YOUR_API_KEY" "https://www.ballparkpal.com/api/v1/parkfactors?date=2026-04-01"
/api/v1/parkfactors/hitters
Returns individual hitter park factors at the game level.
date=YYYY-MM-DD or gameId is required.gameId, gameTime, teamAway, teamHome, playerId, playerName, team, homeRuns, doublesTriples, singles.curl -s -H "X-API-Key: YOUR_API_KEY" "https://www.ballparkpal.com/api/v1/parkfactors/hitters?date=2026-04-01"
/api/v1/matchups
Returns Ballpark Pal matchup model data for all batter-vs-starting-pitcher matchups on a given date. Probabilities are not park-adjusted; combine with /api/v1/parkfactors/hitters if park context is needed.
date=YYYY-MM-DD (required)starters=true (optional; when set, only returns projected starting batters)4.2 = 4.2%).15 = 15% above typical, -8 = 8% below typical).null when no starting pitcher is announced or no model data exists for the matchup.gameId, batterId, batterName, batterTeam, pitcherId, pitcherName, pitcherTeam, homeRunProbability, doubleTripleProbability, singleProbability, walkProbability, strikeoutProbability, runsCreatedVsTypical, homeRunVsTypical, doubleTripleVsTypical, singleVsTypical, walkVsTypical, strikeoutVsTypical.curl -s -H "X-API-Key: YOUR_API_KEY" "https://www.ballparkpal.com/api/v1/matchups?date=2026-04-01"
curl -s -H "X-API-Key: YOUR_API_KEY" "https://www.ballparkpal.com/api/v1/matchups?date=2026-04-01&starters=true"
/api/v1/matchups/predict
Returns Ballpark Pal matchup model probabilities for any batter-pitcher pair. Probabilities are not park-adjusted.
batterId (required integer; MLB player ID)pitcherId (required integer; MLB player ID)matchupAdvantage ranges from -10 (extreme pitcher advantage) to +10 (extreme batter advantage). 0 is neutral.batterPercentile and pitcherPercentile are raw 0–100 values from the model.404 if no model data exists for the given pair.batterId, batterName, batterTeam, pitcherId, pitcherName, pitcherTeam, reachProbability, hitProbability, homeRunProbability, doubleTripleProbability, singleProbability, walkProbability, strikeoutProbability, matchupAdvantage, batterPercentile, pitcherPercentile.curl -s -H "X-API-Key: YOUR_API_KEY" "https://www.ballparkpal.com/api/v1/matchups/predict?batterId=592450&pitcherId=477132"
GET /api/v1/games/776345
{
"meta": {
"asOf": "2026-02-10T03:54:58+00:00",
"requestId": "65a7eadb-d29d-4ead-89c6-f013e0219f5b"
},
"data": {
"gameId": 776345,
"gameDate": "2025-09-12",
"gameTime": "10:10",
"teamAwayId": 108,
"teamHomeId": 136,
"venueId": 680
}
}