OpenAny
Get API keyAPI Key
APIData

mlb-stats logo
MLB Stat Leaderboard API

Fetch sortable MLB stat leaderboards via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as group, limit, output, and retrieve structured data including current pagination offset, next offset, MLB player identifier, player full name, and player position code to build sortable fantasy tables, explore sabermetrics and expected stats, and paginate full league leaderboards.

Selected price
$0.002 / billing creditPublished pricing
Sellers / APIs
1 / 1
Requests · 30d
—Statistics unavailable
Success rate · 30d
—Statistics unavailable
USE THIS API

MLB Stat Leaderboard API

Prepare your request, then continue with your agent.

Pricing

$0.002 / billing credit

Calculated from input parameters and actual returned quantities. Estimate the maximum cost before calling.

Provider
API
Pricing
Connect your agent
On this page

Overview

Overview
MLB Stat Leaderboard API

MLB Stat Leaderboard API

Query sortable player tables with optional group (hitting default, pitching, fielding, catching, running), season, type (season, seasonAdvanced, sabermetrics, expectedStatistics, career, careerAdvanced), sort, order (asc/desc), pool (qualified, all, rookies, qualified_rookies), team_id, league, position, offset, limit (default 50, max 100) and sport_id.

Quick Facts

Fact Value
Access OpenAny REST
Authentication OpenAny API key in the Authorization header
Core inputs Optional query: group, season, type, sort, order (asc/desc), pool, team_id, league (al/nl), position, offset, limit (default 50, max 100), sport_id, raw=0, fields and fresh=1.
Selected implementation apish · MLB stat leaderboard with sorting and filters API
Billing See the pricing area for the selected implementation and request options

What You Can Build

  • Build sortable fantasy tables: Sort qualified hitters by ops or homeRuns, or pitchers by era, whip or strikeOuts with position filters.
  • Explore sabermetrics and expected stats: Set type to sabermetrics or expectedStatistics to surface advanced metrics beyond basic counting stats.
  • Paginate full league leaderboards: Loop over next_offset with limit=100 until next_offset is null to export an entire season table.

Returned Data

Field Meaning
count Number of player rows in this page
total Total matching players across all pages
offset Current pagination offset
next_offset Offset for the next page, or null on the last page
players[].rank Player rank under the selected sort
players[].player.id MLB player identifier
players[].player.name Player full name
players[].position Player position code
players[].league Player league abbreviation
players[].stat Full statistical line object for the player

Quick Start

  1. Set OPENANY_API_KEY to your OpenAny API key.
  2. Review the selected implementation and pricing, then adapt the request below to your target.
  3. Check the HTTP response and business result before reading optional fields.
bash
curl --request GET --get \
  https://api.openany.si/v1/agent-apis/apish/mlb/v1/stats \
  -H "Authorization: Bearer ${OPENANY_API_KEY}" \
  --data-urlencode group=pitching \
  --data-urlencode limit=1 \
  --data-urlencode output=json \
  --data-urlencode raw=0 \
  --data-urlencode season=2026

Request and Response Examples

The response example is a documentation reference and may be abbreviated. The documented request is a calling template; use the published contract and returned response for the selected implementation.

Published MLB Stat Leaderboard API implementation contract.

Pricing and Billing

The pricing area reflects the selected API implementation. Review its billing unit and any request-dependent rules before calling; a source service's public availability does not determine OpenAny billing.

Frequently Asked Questions

View FAQ

Related APIs

Playground

Run sends a real API request. Charges follow the published API contract.

Provider
apish
Endpoint
MLB stat leaderboard with sorting and filters API
Request parameters
Optional parameters (17)
hitting (default), pitching, fielding, catching, running.
Season year; default this year.
season (default), seasonAdvanced, sabermetrics, expectedStatistics, career, careerAdvanced.
Stat to sort by, e.g. homeRuns, avg, ops, era, strikeOuts, whip (default ops for hitting, era for pitching).
asc or desc.
qualified (default), all, rookies, qualified_rookies.
Team id or abbreviation.
al or nl.
C, 1B, 2B, 3B, SS, LF, CF, RF, OF, DH, P, SP, RP.
Rows to skip (from next_offset).
Rows per page (default 50, max 100).
Level: 1 MLB (default), 11 Triple-A, 12 Double-A, 13 High-A, 14 Single-A, 16 Rookie, 17 winter leagues, 51 international.
0 leaves out the bulky `raw` source blocks (often 10-30x smaller).
Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.
1 skips the 24-hour cache and fetches live.
JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.
With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.

Sample response

Run a request to see the actual response. Published samples are in Examples.

Response result

Sellers

SellerPricingRequests · 30dPerformanceAccess
apishCurrent
MLB stat leaderboard with sorting and filters API · GET · View API reference
$0.002 / billing credit—
—successP50—
Selected pricing · apishUSD / billing credit
Pricing
$0.002

Calculated from input parameters and actual returned quantities. Estimate the maximum cost before calling.

Statistics use persisted gateway logs from the last 30 days up to now, including today.
Success rate = successful requests / all requests;
P50 = median latency of successful requests.
Prices reflect the published API contract. Contract revision: 3. Contract updated: Dec 3, 2026, 02:44 AM (UTC).

API

Method
GET
Endpoint
https://api.openany.si/v1/agent-apis/apish/mlb/v1/stats
Content type
application/json
Authentication
Authorization: Bearer $OPENANY_API_KEY
View request and response examples

Input parameters

Fields in this listing; additional options and input encoding can vary by provider.

ParameterLocationTypeRequiredDescription
groupURL query parametersquerystringNo

hitting (default), pitching, fielding, catching, running.

seasonURL query parametersquerystringNo

Season year; default this year.

typeURL query parametersquerystringNo

season (default), seasonAdvanced, sabermetrics, expectedStatistics, career, careerAdvanced.

enum: "season", "seasonAdvanced", "sabermetrics", "expectedStatistics", "career", "careerAdvanced"

sortURL query parametersquerystringNo

Stat to sort by, e.g. homeRuns, avg, ops, era, strikeOuts, whip (default ops for hitting, era for pitching).

orderURL query parametersquerystringNo

asc or desc.

enum: "asc", "desc"

poolURL query parametersquerystringNo

qualified (default), all, rookies, qualified_rookies.

enum: "qualified", "all", "rookies", "qualified_rookies"

team_idURL query parametersquerystringNo

Team id or abbreviation.

leagueURL query parametersquerystringNo

al or nl.

enum: "al", "nl"

positionURL query parametersquerystringNo

C, 1B, 2B, 3B, SS, LF, CF, RF, OF, DH, P, SP, RP.

offsetURL query parametersqueryintegerNo

Rows to skip (from next_offset).

limitURL query parametersqueryintegerNo

Rows per page (default 50, max 100).

sport_idURL query parametersquerystringNo

Level: 1 MLB (default), 11 Triple-A, 12 Double-A, 13 High-A, 14 Single-A, 16 Rookie, 17 winter leagues, 51 international.

enum: "1", "11", "12", "13", "14", "16", "17", "21", "22", "23", "51", "586"

rawURL query parametersquerystringNo

0 leaves out the bulky `raw` source blocks (often 10-30x smaller).

enum: "0", "1"

fieldsURL query parametersquerystringNo

Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.

freshURL query parametersquerystringNo

1 skips the 24-hour cache and fetches live.

enum: "1"

outputURL query parametersquerystringNo

JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.

enum: "json"

recordsURL query parametersquerystringNo

With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.

Required markers inside a nested object or variant apply when that object or variant is used.

Response structure

Inferred from examples
  • applied_filtersobject
    • groupstring
    • leaguenull
    • ordernull
    • poolstring
    • positionnull
    • seasoninteger
    • sortstring
    • sport_idinteger
    • team_idnull
    • typestring
  • cachedboolean
  • countinteger
  • credits_usedinteger
  • fetched_atstring
  • next_offsetinteger
  • offsetinteger
  • playersobject[]
    • leaguestring
    • playerobject
      • idinteger
      • namestring
    • positionstring
    • rankinteger
    • statobject
      • ageinteger
      • airOutsinteger
      • atBatsinteger
      • avgstring
      • balksinteger
      • baseOnBallsinteger
      • battersFacedinteger
      • blownSavesinteger
      • catchersInterferenceinteger
      • caughtStealinginteger
      • caughtStealingPercentagestring
      • completeGamesinteger
      • doublesinteger
      • earnedRunsinteger
      • erastring
      • gamesFinishedinteger
      • gamesPitchedinteger
      • gamesPlayedinteger
      • gamesStartedinteger
      • groundIntoDoublePlayinteger
      • groundOutsinteger
      • groundOutsToAiroutsstring
      • hitBatsmeninteger
      • hitByPitchinteger
      • hitsinteger
      • hitsPer9Innstring
      • holdsinteger
      • homeRunsinteger
      • homeRunsPer9string
      • inheritedRunnersinteger
      • inheritedRunnersScoredinteger
      • inningsPitchedstring
      • intentionalWalksinteger
      • lossesinteger
      • numberOfPitchesinteger
      • obpstring
      • opsstring
      • outsinteger
      • pickoffsinteger
      • pitchesPerInningstring
      • runsinteger
      • runsScoredPer9string
      • sacBuntsinteger
      • sacFliesinteger
      • saveOpportunitiesinteger
      • savesinteger
      • shutoutsinteger
      • slgstring
      • stolenBasePercentagestring
      • stolenBasesinteger
      • strikeOutsinteger
      • strikePercentagestring
      • strikeoutWalkRatiostring
      • strikeoutsPer9Innstring
      • strikesinteger
      • totalBasesinteger
      • triplesinteger
      • walksPer9Innstring
      • whipstring
      • wildPitchesinteger
      • winPercentagestring
      • winsinteger
    • teamobject
      • abbreviationstring
      • idinteger
      • namestring
  • totalinteger

Composite rule pricing

Calculated from input parameters and actual returned quantities. Estimate the maximum cost before calling.

Base fee: $0.000000. One matching variant replaces the base fee. Matching add-ons and quantity charges are added.

Fee itemPriceMetering sourceWhenQuantity limit
Actual API.SH credits consumed$0.002000 / billing creditResponse · /credits_used · Numeric valueAlways1 billing credit · Decimal places: 0

Each quantity charge is rounded before summing: ceil. Requests exceeding this cost limit are rejected; it is not a price cap: $0.002000.

Response quantities settle after the response. Before execution, the maximum quantity determines the reservation; unused reservation is released. Missing or invalid quantities are not treated as zero.

Pricing parameters and defaults
[]

Agent integration

Copy the resource contract without sharing an API key.

Download MDView API Markdown

Error handling

StatusNext step
400Check the offering and request fields.
401 / 403Verify your credentials and access permissions.
402Inspect the selected access mode and returned payment requirements.
429Respect the returned rate limit and retry guidance.
5xxInspect the error and usage record before retrying a paid operation.

Examples

Official example · Live API.SH response · Minimal request

Example from the provider's documentation. Field values in your results will differ.

  1. Prepare your environment

    Use a terminal with cURL installed.

    Use an OpenAny API key with shared-balance access. Confirm availability and price before running; a call may charge your balance.

    Set the key in your terminal using the hidden prompt below. Keep its value out of source files and logs.

    Terminal · macOS / Linux
    printf 'OpenAny API key: '
    read -r -s OPENANY_API_KEY
    export OPENANY_API_KEY
    printf '\n'
  2. Run the request

    Paste the complete command below into your terminal.

    Values to replace before running 17

    Review these request fields before running. Keep the published provider and request method unchanged.

    group
    hitting (default), pitching, fielding, catching, running.
    season
    Season year; default this year.
    type
    season (default), seasonAdvanced, sabermetrics, expectedStatistics, career, careerAdvanced.
    sort
    Stat to sort by, e.g. homeRuns, avg, ops, era, strikeOuts, whip (default ops for hitting, era for pitching).
    order
    asc or desc.
    pool
    qualified (default), all, rookies, qualified_rookies.
    team_id
    Team id or abbreviation.
    league
    al or nl.
    position
    C, 1B, 2B, 3B, SS, LF, CF, RF, OF, DH, P, SP, RP.
    offset
    Rows to skip (from next_offset).
    limit
    Rows per page (default 50, max 100).
    sport_id
    Level: 1 MLB (default), 11 Triple-A, 12 Double-A, 13 High-A, 14 Single-A, 16 Rookie, 17 winter leagues, 51 international.
    raw
    0 leaves out the bulky `raw` source blocks (often 10-30x smaller).
    fields
    Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.
    fresh
    1 skips the 24-hour cache and fetches live.
    output
    JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.
    records
    With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.
    Terminal · cURL
    curl \
      'https://api.openany.si/v1/agent-apis/apish/mlb/v1/stats?group=pitching&limit=1&output=json&raw=0&season=2026' \
      -X GET \
      -H "Authorization: Bearer $OPENANY_API_KEY" \
      -H 'Content-Type: application/json'
  3. Check the response

    Sample response · Documented HTTP 200

    Sample response
    {
      "applied_filters": {
        "group": "pitching",
        "league": null,
        "order": null,
        "pool": "qualified",
        "position": null,
        "season": 2026,
        "sort": "earnedRunAverage",
        "sport_id": 1,
        "team_id": null,
        "type": "season"
      },
      "cached": false,
      "count": 1,
      "credits_used": 1,
      "fetched_at": "2026-11-19T12:22:09.494Z",
      "next_offset": 1,
      "offset": 0,
      "players": [
        {
          "league": "NL",
          "player": {
            "id": 694819,
            "name": "Jacob Misiorowski"
          },
          "position": "P",
          "rank": 1,
          "stat": {
            "age": 24,
            "airOuts": 138,
            "atBats": 610,
            "avg": ".157",
            "balks": 1,
            "baseOnBalls": 44,
            "battersFaced": 665,
            "blownSaves": 0,
            "catchersInterference": 0,
            "caughtStealing": 1,
            "caughtStealingPercentage": ".333",
            "completeGames": 1,
            "doubles": 8,
            "earnedRuns": 35,
            "era": "1.80",
            "gamesFinished": 0,
            "gamesPitched": 30,
            "gamesPlayed": 30,
            "gamesStarted": 30,
            "groundIntoDoublePlay": 11,
            "groundOuts": 126,
            "groundOutsToAirouts": "0.91",
            "hitBatsmen": 9,
            "hitByPitch": 9,
            "hits": 96,
            "hitsPer9Inn": "4.95",
            "holds": 0,
            "homeRuns": 14,
            "homeRunsPer9": "0.72",
            "inheritedRunners": 0,
            "inheritedRunnersScored": 0,
            "inningsPitched": "174.2",
            "intentionalWalks": 0,
            "losses": 5,
            "numberOfPitches": 2647,
            "obp": ".224",
            "ops": ".470",
            "outs": 524,
            "pickoffs": 0,
            "pitchesPerInning": "15.15",
            "runs": 43,
            "runsScoredPer9": "2.22",
            "sacBunts": 1,
            "sacFlies": 1,
            "saveOpportunities": 0,
            "saves": 0,
            "shutouts": 1,
            "slg": ".246",
            "stolenBasePercentage": ".667",
            "stolenBases": 2,
            "strikeOuts": 252,
            "strikePercentage": ".680",
            "strikeoutWalkRatio": "5.73",
            "strikeoutsPer9Inn": "12.98",
            "strikes": 1789,
            "totalBases": 150,
            "triples": 2,
            "walksPer9Inn": "2.27",
            "whip": "0.80",
            "wildPitches": 6,
            "winPercentage": ".762",
            "wins": 16
          },
          "team": {
            "abbreviation": "MIL",
            "id": 158,
            "name": "Milwaukee Brewers"
          }
        }
      ],
      "total": 46
    }

Common questions

How do I paginate through more than 100 players?

Use limit (default 50, max 100) and pass the returned next_offset value into offset until next_offset is null.

Are sabermetrics and expected statistics supported?

Yes. The type parameter accepts season, seasonAdvanced, sabermetrics, expectedStatistics, career and careerAdvanced.

How do I filter for rookies or unqualified players?

Set pool to qualified (default), all, rookies or qualified_rookies.

Can I filter the leaderboard by fielding position or club?

Yes. Pass position (e.g. C, 1B, SS, OF, SP, RP) and team_id (numeric ID or abbreviation).

What default sort is used if I omit sort?

It defaults to ops for hitting and era for pitching; pass order=asc or order=desc to control direction.

How do caching and payload trimming work?

Pass fresh=1 to skip the 24-hour cache, raw=0 to omit bulky raw blocks and fields to select specific keys.

Use MLB Stat Leaderboard API with your agent

Inspect endpoint contracts and confirm availability and pricing before a paid call.