{"uid":"cap_LsB_2qHn2pLuDpS46AN2-","slug":"mlb-stats-api-fly-dev-2b812f54","name":"MLB Player Season Stats","description":"Season hitting, pitching, and fielding stats for a player. Example: 660271 = Shohei Ohtani.","url":"https://mlb-stats-api.fly.dev/mlb/player/:player_id","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"pathParams":{"type":"object","required":["player_id"],"properties":{"player_id":{"type":"string","description":"MLB player ID"}}},"queryParams":{"type":"object","properties":{}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"object","required":["data","sport","errors","league","warnings","request_id","retrieved_at"],"properties":{"data":{"type":"object","required":["id","bats","stats","status","throws","team_id","position","full_name","last_name","first_name","jersey_number"],"properties":{"id":{"type":"string"},"bats":{"type":"string"},"stats":{"type":"array","items":{"type":"object","required":["type","group","splits","exemptions"],"properties":{"type":{"type":"object","required":["displayName"],"properties":{"displayName":{"type":"string"}}},"group":{"type":"object","required":["displayName"],"properties":{"displayName":{"type":"string"}}},"splits":{"type":"array","items":{"type":"object","required":["stat","team","sport","league","player","season","gameType","position"],"properties":{"stat":{"type":"object","required":["age","games","errors","assists","chances","innings","putOuts","fielding","position","doublePlays","gamesPlayed","triplePlays","gamesStarted","throwingErrors","rangeFactorPer9Inn","rangeFactorPerGame"],"properties":{"age":{"type":"number"},"games":{"type":"number"},"errors":{"type":"number"},"assists":{"type":"number"},"chances":{"type":"number"},"innings":{"type":"string"},"putOuts":{"type":"number"},"fielding":{"type":"string"},"position":{"type":"object"},"doublePlays":{"type":"number"},"gamesPlayed":{"type":"number"},"triplePlays":{"type":"number"},"gamesStarted":{"type":"number"},"throwingErrors":{"type":"number"},"rangeFactorPer9Inn":{"type":"string"},"rangeFactorPerGame":{"type":"string"}}},"team":{"type":"object","required":["id","link","name"],"properties":{"id":{"type":"number"},"link":{"type":"string"},"name":{"type":"string"}}},"sport":{"type":"object","required":["id","link","abbreviation"],"properties":{"id":{"type":"number"},"link":{"type":"string"},"abbreviation":{"type":"string"}}},"league":{"type":"object","required":["id","link","name"],"properties":{"id":{"type":"number"},"link":{"type":"string"},"name":{"type":"string"}}},"player":{"type":"object","required":["id","link","fullName"],"properties":{"id":{"type":"number"},"link":{"type":"string"},"fullName":{"type":"string"}}},"season":{"type":"string"},"gameType":{"type":"string"},"position":{"type":"object","required":["code","name","type","abbreviation"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"abbreviation":{"type":"string"}}}}}},"exemptions":{"type":"array","items":{"type":"unknown"}}}}},"status":{"type":"string"},"throws":{"type":"string"},"team_id":{"type":"string"},"position":{"type":"string"},"full_name":{"type":"string"},"last_name":{"type":"string"},"first_name":{"type":"string"},"jersey_number":{"type":"string"}}},"sport":{"type":"string"},"errors":{"type":"array","items":{"type":"unknown"}},"league":{"type":"string"},"warnings":{"type":"array","items":{"type":"unknown"}},"request_id":{"type":"string"},"retrieved_at":{"type":"string"}}},"example":{"request":{"input":{"type":"http","method":"GET","pathParams":{"player_id":"543037"}}},"response":{"data":{"id":"543037","bats":"R","stats":[{"type":{"displayName":"season"},"group":{"displayName":"fielding"},"splits":[{"stat":{"age":35,"games":5,"errors":0,"assists":2,"chances":5,"innings":"28.0","putOuts":3,"fielding":"1.000","position":{"code":"1","name":"Pitcher","type":"Pitcher","abbreviation":"P"},"doublePlays":0,"gamesPlayed":5,"triplePlays":0,"gamesStarted":5,"throwingErrors":0,"rangeFactorPer9Inn":"1.61","rangeFactorPerGame":"1.00"},"team":{"id":147,"link":"/api/v1/teams/147","name":"New York Yankees"},"sport":{"id":1,"link":"/api/v1/sports/1","abbreviation":"MLB"},"league":{"id":103,"link":"/api/v1/league/103","name":"American League"},"player":{"id":543037,"link":"/api/v1/people/543037","fullName":"Gerrit Cole"},"season":"2026","gameType":"R","position":{"code":"1","name":"Pitcher","type":"Pitcher","abbreviation":"P"}}],"exemptions":[]},{"type":{"displayName":"season"},"group":{"displayName":"pitching"},"splits":[{"stat":{"age":35,"avg":".196","era":"2.57","obp":".261","ops":".614","slg":".353","hits":20,"outs":84,"runs":8,"whip":"1.00","wins":2,"balks":0,"holds":0,"saves":0,"atBats":102,"losses":1,"airOuts":38,"doubles":4,"strikes":277,"triples":0,"homeRuns":4,"pickoffs":1,"sacBunts":0,"sacFlies":0,"shutouts":0,"blownSaves":0,"earnedRuns":8,"groundOuts":20,"hitBatsmen":1,"hitByPitch":1,"strikeOuts":24,"totalBases":36,"baseOnBalls":8,"gamesPlayed":5,"hitsPer9Inn":"6.43","stolenBases":2,"wildPitches":0,"battersFaced":112,"gamesPitched":5,"gamesStarted":5,"homeRunsPer9":"1.29","walksPer9Inn":"2.57","completeGames":0,"gamesFinished":0,"winPercentage":".667","caughtStealing":1,"inningsPitched":"28.0","runsScoredPer9":"2.57","numberOfPitches":407,"inheritedRunners":0,"intentionalWalks":0,"pitchesPerInning":"14.54","strikePercentage":".680","saveOpportunities":0,"strikeoutsPer9Inn":"7.71","strikeoutWalkRatio":"3.00","groundOutsToAirouts":"0.53","catchersInterference":1,"groundIntoDoublePlay":0,"stolenBasePercentage":".667","inheritedRunnersScored":0,"caughtStealingPercentage":".333"},"team":{"id":147,"link":"/api/v1/teams/147","name":"New York Yankees"},"sport":{"id":1,"link":"/api/v1/sports/1","abbreviation":"MLB"},"league":{"id":103,"link":"/api/v1/league/103","name":"American League"},"player":{"id":543037,"link":"/api/v1/people/543037","fullName":"Gerrit Cole"},"season":"2026","gameType":"R"}],"exemptions":[]}],"status":"active","throws":"R","team_id":"147","position":"P","full_name":"Gerrit Cole","last_name":"Cole","first_name":"Gerrit","jersey_number":"45"},"sport":"baseball","errors":[],"league":"mlb","warnings":[],"request_id":"8bbab186-7dd7-46b6-a7d2-b38170343ec2","retrieved_at":"2026-06-18T05:01:49.806202+00:00"}},"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001000","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001000/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_zem2eDwgCdo9kRFEtAKBF","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns season hitting, pitching, and fielding statistics for an MLB player by their player ID.","exampleAgentPrompt":"Can you pull up Shohei Ohtani's season stats — his hitting, pitching, and fielding numbers? His MLB player ID is 660271.","exampleUseCases":null,"resultDescription":"Returns the player's season statistics including hitting (e.g. batting average, home runs, RBIs), pitching (e.g. ERA, strikeouts, wins), and fielding stats for the current MLB season.","failureModes":["Invalid or unknown player_id returns an error or empty response","Player exists but has no stats for the current season (e.g. injured, traded, or inactive)","Network or server error from the fly.dev host","Payment failure via x402 protocol prevents the request from completing"],"whenToPreferThis":"Use this endpoint when you need comprehensive season statistics (hitting, pitching, and fielding) for a specific MLB player by their numeric player ID. Ideal for fantasy baseball lookups, player comparisons, or sports reporting tasks where you know the player's MLB ID.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T06:32:55.985Z","isFirstParty":false}