Eight fictional baseball teams with batting and pitching stats, a scoreboard, live games advanced inning by inning (extra innings included), play-by-play, standings and leaders.
Base URL: https://funapi.dev/api/baseball/v1 · 11 endpoints · OpenAPI 3.1 spec and Postman collection available. New here? Read the getting started guide.
teams and rosters
GET /baseball/v1/teams — List the 8 teams · Responds with 200 Link to this endpointGET /baseball/v1/teams/{id} — One team with its record · Responds with 200 404 Link to this endpointGET /baseball/v1/teams/{id}/roster — A team's roster with season stats · Responds with 200 404 Link to this endpointplayers and stats
GET /baseball/v1/players — Search and page through players · Responds with 200 400 Link to this endpointGET /baseball/v1/players/{id} — One player and their season stats · Responds with 200 404 Link to this endpointscoreboard and live games
GET /baseball/v1/games — Scoreboard: filter by week, team or status · Responds with 200 400 Link to this endpointGET /baseball/v1/games/{id} — One game — ETag changes when the score does; poll with If-None-Match for 304 · Responds with 200 304 404 Link to this endpointGET /baseball/v1/games/{id}/plays — Play-by-play; pass after=<last id> to read only new plays · Responds with 200 404 Link to this endpointPOST /baseball/v1/games/{id}/advance — Play the next inning of a game (admin) — then watch the ETag change (requires Bearer auth) · Responds with 200 401 403 404 409 422 Link to this endpointstandings and leaders
GET /baseball/v1/standings — Standings computed from final games · Responds with 200 Link to this endpointGET /baseball/v1/leaders — Stat leaders · Responds with 200 400 Link to this endpointThe Baseball Stats API is a fictional nine-inning league with batting and pitching numbers, a scoreboard, standings and leaders — including ERA, where the best value is the lowest, which is exactly the kind of rule a sort test should catch. Live games advance inning by inning, and a tied game is settled with a walk-off in the ninth so a final is never a draw.
GET https://funapi.dev/api/baseball/v1/teams — List the 8 teams. No token, no signup:
curl -i https://funapi.dev/api/baseball/v1/teams
Response: 200 OK
{
"league": "Fun Baseball League",
"data": [
{
"id": 1,
"city": "River City",
"name": "Rapids",
"fullName": "River City Rapids",
"abbreviation": "RCR",
"conference": "American",
"venue": "River City Park"
},
{
"id": 2,
"city": "Maple Grove",
"name": "Maples",
"fullName": "Maple Grove Maples",
"abbreviation": "MGM",
"conference": "American",
"venue": "Maple Grove Park"
},
{
"id": 3,
"city": "Fort Union",
"name": "Patriots",
"fullName": "Fort Union Patriots",
"abbreviation": "FUP",
"conference": "American",
"venue": "Fort Union Field"
},
{
"id": 4,
"city": "Bluewater",
"name": "Pelicans",
"fullName": "Bluewater Pelicans",
"abbreviation": "BWP",
"conference": "American",
"venue": "Bluewater Field"
},
{
"id": 5,
"city": "Desert Springs",
"name": "Scorpions",
"fullName": "Desert Springs Scorpions",
"abbreviation": "DSS",
"conference": "National",
(truncated — the full response comes back when you run it)
How these leagues differ from balldontlie
Last updated