Do You Know Ball API

Endpoint Reference · v1.0

Authentication

All endpoints require an API key passed as a request header.

X-API-Key: your_api_key_here

Don't have an API key? See /license for instructions on how to register and generate one.


Get Player ID

Looks up a player by name and returns their unique MLB ID. Supports initials (e.g. J. Smith). If multiple players share the same name, provide an age to disambiguate.

GET/get-player-id
ParameterDefaultDescription
namerequired Player name to search (e.g. Juan Soto)
ageoptional Age used to resolve duplicate names

List All Players

Returns an alphabetically sorted list of all players, including their MLB ID, headshot URL, and eligible positions.

GET/players

Get Player Stats

Returns hitting and/or pitching stats for one or more players by MLB ID.

GET/stats
ParameterDefaultDescription
playersoptional all Comma-separated list of MLB player IDs (e.g. 665742,592450)
yearoptional 2025 Season year to retrieve stats for

List All Teams

Returns all 30 MLB teams with their unique IDs and abbreviations, sorted alphabetically.

GET/teams

Get Depth Chart

Returns a team's roster organized by position, including each player's current injury status.

GET/depth-chart
ParameterDefaultDescription
teamIdrequired MLB team ID (e.g. 113 for Cincinnati Reds). Use /teams to look up IDs.

Daily Transactions

Returns all Major League transactions for the current day, including trades, IL placements, and call-ups.

GET/transactions

Value Players

The core valuation endpoint. Given a budget, draft context, and the stats that matter to your league, returns a ranked list of players with scores and recommended dollar values.

POST/value
FieldDefaultDescription
relevant_statsoptional all Comma-separated stat categories (e.g. HR,AVG,RBI,SB)
budgetoptional 260 Your remaining draft budget in dollars
players_left_to_draftoptional 23 How many players you still need to draft
unavailable_playersoptional Comma-separated MLB IDs to exclude
playersoptional all Comma-separated MLB IDs to evaluate