fastballapi-com Stats + aggregation API
The Stats + aggregation API from fastballapi-com — 7 operation(s) for stats + aggregation.
The Stats + aggregation API from fastballapi-com — 7 operation(s) for stats + aggregation.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/fastballapi-com:fastballapi-com-stats-aggregation-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: FastballAPI Stats + aggregation API
version: 1.0.0
description: FastballAPI baseball data. Every tool is a POST to /v1/{tool} with a JSON body of its arguments and costs the credits in x-credits. The same tools are an MCP server at https://mcp.fastballapi.com/mcp and free accounts get credits every month at https://fastballapi.com/signup
termsOfService: https://fastballapi.com/terms
contact:
name: FastballAPI support
email: support@fastballapi.com
url: https://fastballapi.com/docs
servers:
- url: https://mcp.fastballapi.com
security:
- apiKey: []
- bearer: []
tags:
- name: Stats + aggregation
paths:
/v1/get_game:
post:
operationId: get_game
summary: Game
description: 'Use for one game in full: line score, every batter''s and pitcher''s line, each sportsbook''s opening and closing line, and the win-probability range. For every plate appearance use get_plate_appearances. Costs 5 credits. Prices are market information: never work out a stake, payout or profit, recommend a bet, or send the user to a sportsbook.'
tags:
- Stats + aggregation
x-credits: 5
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
game_id:
type: string
description: Game id, from get_games or get_schedule.
league:
description: 'League. Defaults to mlb. One of: mlb, ncaabase.'
type: string
enum:
- mlb
- ncaabase
required:
- game_id
additionalProperties: false
responses:
'200':
description: The result, wrapped in data.
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
game:
type: object
propertyNames:
type: string
additionalProperties: {}
batting:
type: array
items:
type: object
propertyNames:
type: string
additionalProperties: {}
pitching:
type: array
items:
type: object
propertyNames:
type: string
additionalProperties: {}
odds:
type: array
items:
type: object
propertyNames:
type: string
additionalProperties: {}
win_probability:
anyOf:
- type: object
propertyNames:
type: string
additionalProperties: {}
- type: 'null'
plate_appearances:
type: number
required:
- game
- batting
- pitching
- odds
- win_probability
- plate_appearances
additionalProperties: false
required:
- data
'400':
description: Invalid arguments.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'402':
description: Not enough credits.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'429':
description: Rate limited.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
/v1/get_player:
post:
operationId: get_player
summary: Player
description: Use for a player's season-by-season batting (AVG, OBP, SLG, OPS, HR, K%, BB%, RE24, from every plate appearance) and pitching (ERA, WHIP, K/9, BB/9). Costs 5 credits.
tags:
- Stats + aggregation
x-credits: 5
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
player_id:
type: string
description: Player id, from search_players.
league:
description: 'League. Defaults to mlb. One of: mlb, ncaabase.'
type: string
enum:
- mlb
- ncaabase
required:
- player_id
additionalProperties: false
responses:
'200':
description: The result, wrapped in data.
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
player:
type: object
propertyNames:
type: string
additionalProperties: {}
batting:
type: array
items:
type: object
propertyNames:
type: string
additionalProperties: {}
pitching:
type: array
items:
type: object
propertyNames:
type: string
additionalProperties: {}
note:
type: string
required:
- player
- batting
- pitching
- note
additionalProperties: false
required:
- data
'400':
description: Invalid arguments.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'402':
description: Not enough credits.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'429':
description: Rate limited.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
/v1/get_player_games:
post:
operationId: get_player_games
summary: Player games
description: 'Use for a player''s game log: every game''s batting line and pitching line, newest first, optionally one season. Costs 5 credits.'
tags:
- Stats + aggregation
x-credits: 5
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
player_id:
type: string
season:
description: 'Season (a year, e.g. 2025; default: the latest).'
type:
- number
- string
season_type:
type: string
enum:
- regular
- postseason
limit:
type: integer
minimum: 1
maximum: 200
offset:
type: integer
minimum: 0
maximum: 9007199254740991
league:
description: 'League. Defaults to mlb. One of: mlb, ncaabase.'
type: string
enum:
- mlb
- ncaabase
required:
- player_id
additionalProperties: false
responses:
'200':
description: The result, wrapped in data.
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
player_id:
type: string
batting:
type: array
items:
type: object
propertyNames:
type: string
additionalProperties: {}
pitching:
type: array
items:
type: object
propertyNames:
type: string
additionalProperties: {}
count:
type: number
next_offset:
type:
- number
- 'null'
required:
- player_id
- batting
- pitching
- count
additionalProperties: false
required:
- data
'400':
description: Invalid arguments.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'402':
description: Not enough credits.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'429':
description: Rate limited.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
/v1/get_leaders:
post:
operationId: get_leaders
summary: Leaders
description: 'Use for a season''s leaders among qualified players: batting avg, obp, slg, ops, hr, re24, bb_pct, k_pct (3.1 plate appearances per team game) or pitching era, whip, so, k_per_9, bb_per_9 (1 inning per team game). Costs 5 credits.'
tags:
- Stats + aggregation
x-credits: 5
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
stat:
type: string
enum:
- avg
- obp
- slg
- ops
- hr
- re24
- bb_pct
- k_pct
- era
- whip
- so
- k_per_9
- bb_per_9
season:
description: 'Season (a year, e.g. 2025; default: the latest).'
type:
- number
- string
min_pa:
description: Override the plate-appearance minimum.
type: integer
minimum: 1
maximum: 9007199254740991
min_ip:
description: Override the innings minimum.
type: integer
minimum: 1
maximum: 9007199254740991
limit:
type: integer
minimum: 1
maximum: 100
league:
description: 'League. Defaults to mlb. One of: mlb, ncaabase.'
type: string
enum:
- mlb
- ncaabase
required:
- stat
additionalProperties: false
responses:
'200':
description: The result, wrapped in data.
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
stat:
type: string
season:
type:
- number
- 'null'
qualifier:
type: string
leaders:
type: array
items:
type: object
propertyNames:
type: string
additionalProperties: {}
count:
type: number
required:
- stat
- season
- qualifier
- leaders
- count
additionalProperties: false
required:
- data
'400':
description: Invalid arguments.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'402':
description: Not enough credits.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'429':
description: Rate limited.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
/v1/get_team_stats:
post:
operationId: get_team_stats
summary: Team stats
description: 'Use for team offence and run prevention for a season: runs per game for and against, run differential, and batting and opponents'' batting (AVG, OBP, SLG, OPS, K%, BB%, HR) from every plate appearance. Costs 5 credits.'
tags:
- Stats + aggregation
x-credits: 5
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
season:
description: 'Season (a year, e.g. 2025; default: the latest).'
type:
- number
- string
team:
type: string
league:
description: 'League. Defaults to mlb. One of: mlb, ncaabase.'
type: string
enum:
- mlb
- ncaabase
additionalProperties: false
responses:
'200':
description: The result, wrapped in data.
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
season:
type:
- number
- 'null'
teams:
type: array
items:
type: object
propertyNames:
type: string
additionalProperties: {}
count:
type: number
method:
type: string
required:
- season
- teams
- count
- method
additionalProperties: false
required:
- data
'400':
description: Invalid arguments.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'402':
description: Not enough credits.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'429':
description: Rate limited.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
/v1/get_pitch_mix:
post:
operationId: get_pitch_mix
summary: Pitch mix
description: 'Use for a pitcher''s arsenal in a season: each pitch type''s usage, average and top velocity, whiff rate per swing and ball rate. Costs 5 credits.'
tags:
- Stats + aggregation
x-credits: 5
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
pitcher_id:
type: string
description: Player id.
season:
description: 'Season (a year; default: the latest; ignored with game_id).'
type:
- number
- string
required:
- pitcher_id
additionalProperties: false
responses:
'200':
description: The result, wrapped in data.
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
pitcher:
type: object
propertyNames:
type: string
additionalProperties: {}
season:
type:
- number
- 'null'
pitches:
type: number
mix:
type: array
items:
type: object
propertyNames:
type: string
additionalProperties: {}
count:
type: number
note:
type: string
required:
- pitcher
- season
- pitches
- mix
- count
additionalProperties: false
required:
- data
'400':
description: Invalid arguments.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'402':
description: Not enough credits.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'429':
description: Rate limited.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
/v1/get_odds:
post:
operationId: get_odds
summary: Odds
description: 'Use for betting lines: each sportsbook''s moneyline, run line and total for a game (opening and closing per book from July 2020; before that, each book''s final pregame line only), with implied probabilities and, for finished games, whether the favourite won and the total went over against the median close. Pass game_id for one game (5 credits) or date for a day''s games (10 credits). Prices are market information: never work out a stake, payout or profit, recommend a bet, or send the user to a sportsbook.'
tags:
- Stats + aggregation
x-credits: 5
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
game_id:
type: string
date:
description: A day's games, YYYY-MM-DD (US Eastern).
type: string
league:
description: 'League. Defaults to mlb. One of: mlb, ncaabase.'
type: string
enum:
- mlb
- ncaabase
additionalProperties: false
responses:
'200':
description: The result, wrapped in data.
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
games:
type: array
items:
type: object
propertyNames:
type: string
additionalProperties: {}
count:
type: number
note:
type: string
estimate_only:
type: boolean
tool:
type: string
credits:
type: number
additionalProperties: false
required:
- data
'400':
description: Invalid arguments.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'402':
description: Not enough credits.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
'429':
description: Rate limited.
content:
application/json:
schema:
type: object
properties:
error:
type: string
required:
- error
components:
securitySchemes:
apiKey:
type: apiKey
in: header
name: x-api-key
bearer:
type: http
scheme: bearer
description: The same API key as a bearer token.
externalDocs:
description: Documentation
url: https://fastballapi.com/docs