MLB Stats API Docs

Type to search endpoints by name, path, or keyword.

GET/api/v1/people/{personId}

Get person

A player, coach, or umpire by id.

On this page

Try it

Path
Query
https://statsapi.mlb.com/api/v1/people/660271
const res = await fetch('https://statsapi.mlb.com/api/v1/people/660271')
const data = await res.json()
curl -s 'https://statsapi.mlb.com/api/v1/people/660271'

Reference

Path parameters

NameTypeRequiredDescription
personIdnumberyes

Person id, e.g. 660271 (Shohei Ohtani).

Query parameters

NameTypeRequiredDescription
hydratecsvno

e.g. currentTeam,stats(group=hitting,type=season).

fieldscsvno

Comma-separated field paths to keep (trims the response), e.g. people,id,fullName.

Response

Type: PeopleResponse

/**
 * `GET /api/v1/people/{personId}`, `/people/search`, and `/people/changes` all
 * return a `people` array.
 */
export interface PeopleResponse extends WithCopyright {
	people: Person[]
}

Notes

  • Response is wrapped in a people array of length 1.

Build with it

Live examples powered by this endpoint with real data. Inspiration — restyle and remix freely.

Player card

Headshot, bio, and current team — a profile header from one call.

Loading live data…

Example URLs

  • Shohei Ohtani: https://statsapi.mlb.com/api/v1/people/660271