Sourcelane

MLB Stats Scraper

Sports Data

Operated by Sourcelane✓ verified

A web-scraping connector that extracts Major League Baseball data on demand across seven scraping modes to produce structured sports statistics: team metadata, active rosters with current-season batting and pitching stat lines, game schedules with status and venue, per-team box-score details (runs, hits, extra-base hits, home runs, RBIs, walks, strikeouts, innings pitched, pitching ERA), season-level player stat lines for hitting/pitching/fielding, division and league standings (rank, wins, losses, win percentage, games back, streak), and ranked stat leaderboards. Supports queries by date or date range, seasons, leagues/divisions, teams, players, and game identifiers, and emits typed records for mixed-mode extraction useful for aggregation, time-series analysis, fantasy and betting models, media feeds, and analytics.

Verified Sep 28, 3:55 AM

$0.004

per record

Up to 100 per call. Only pay for results returned; failed calls are refunded.

What people use it for

Trust & reliability

7d uptime trend
WindowUptimeSuccess ratep50p95Calls
24h————0
7d————0
30d————0

Calling contract

Call it through Sourcelane's gateway or MCP server. We run the connector, apply your agent's spend guardrails, and bill only the results returned.

Call it via Sourcelane

curl -X POST https://api.usesourcelane.com/v1/call \
  -H "Authorization: Bearer sl_live_your_agent_key" \
  -H "Content-Type: application/json" \
  -d '{"listing":"mlb-stats-scraper","params":{"mode":"teams","maxItems":5},"maxResults":10}'

Request params

FieldTypeRequiredDescription
modestringrequiredWhat to scrape. 'teams' lists all MLB teams. 'roster' returns a team's active roster with player season stats. 'schedule' returns games/scores for a date or date range. 'standings' returns division and league standings. 'playerStats' returns full season stat lines for specific players or teams. 'gameDetails' returns per-team box score lines (2 rows per game). 'leaders' returns ranked statistical l
teamIdintegeroptionalMLB team ID for 'roster' mode, e.g. 147 for the New York Yankees. Run 'teams' mode first to look up IDs. Ignored in other modes.
teamAbbreviationstringoptionalOptional alternative to Team ID for 'roster' mode, e.g. 'NYY'. Used only if Team ID is not set. Ignored in other modes.
datestringoptionalSingle date in YYYY-MM-DD format for 'schedule' mode, or for 'gameDetails' mode when Game PKs are not set. Leave empty to use today's date, or set Start Date / End Date instead for a range. Ignored in other modes.
startDatestringoptionalStart of a date range (YYYY-MM-DD) for 'schedule' mode or for 'gameDetails' mode when Game PKs are not set. Requires End Date to also be set; overrides Date when both are present. Ignored in other modes.
endDatestringoptionalEnd of a date range (YYYY-MM-DD) for 'schedule' mode or for 'gameDetails' mode when Game PKs are not set. Requires Start Date to also be set. Ignored in other modes.
gameTypestringoptionalFilters games by MLB game type in 'schedule' mode and in 'gameDetails' mode (when Game PKs are not set), and tags the game type used for 'leaders' mode. Default is Regular Season. Note: MLB has no single generic 'postseason' filter — select the specific postseason round (Wild Card, Division Series, LCS, or World Series).
leagueIdstringoptionalWhich league's standings to return in 'standings' mode. Ignored in other modes.
seasonsarrayoptionalFour-digit season years, e.g. ['2025','2026']. Used by 'playerStats', 'standings', and 'leaders' modes — when multiple seasons are given, each mode loops over all of them and tags every output row with its 'season' field so a multi-season run stays separable in one results. Leave empty to use the current season. In 'roster' mode only the first season is used (roster reflects the current team, not
teamIdsarrayoptionalMLB team IDs for 'playerStats' mode. Every player on each team's active roster gets a stat line for the selected Stat group and each selected season. Ignored if Player IDs is set. Ignored in other modes.
playerIdsarrayoptionalMLB player IDs for 'playerStats' mode, e.g. ['592450'] for Aaron Judge. When set, fetches these specific players' stats directly instead of resolving via Team IDs. Ignored in other modes.
statGroupstringoptionalWhich stat category to return in 'playerStats' and 'leaders' modes. Ignored in other modes.
leaderCategoriesarrayoptionalMLB stat leader category keys for 'leaders' mode, e.g. ['homeRuns','battingAverage','earnedRunAverage','strikeouts','saves']. Must match the selected Stat group (hitting categories with statGroup=hitting, pitching categories with statGroup=pitching, etc). Defaults to ['homeRuns']. Ignored in other modes.
gamePksarrayoptionalSpecific MLB game IDs (gamePk) for 'gameDetails' mode, e.g. ['824911']. When set, fetches box scores for exactly these games instead of deriving games from Date / Start Date / End Date. Ignored in other modes.
maxItemsintegeroptionalMaximum results records to return in this run. 0 = no cap. 'gameDetails' mode produces 2 rows per game, so its effective game count is roughly half this value (also safety-capped at 50 games when unlimited). Mainly relevant for 'roster', 'schedule', 'playerStats', 'gameDetails', and 'leaders' modes; 'teams' always returns 30 or fewer and 'standings' returns one record per team per season. Capped at 100 per call.

Each result contains

FieldTypeDescription
recordTypestringRecord Type
gamePkinteger—
gameDatestring—
officialDatestring—
statusstring—
gameTypestring—
seriesDescriptionstring—
venuestring—
homeTeamIdinteger—
homeTeamstring—
homeScoreinteger—
awayTeamIdinteger—
awayTeamstring—
awayScoreinteger—
winnerstring—

Use MLB Stats Scraper from Claude, ChatGPT or Cursor

Pick your tool and connect in under a minute. Then just ask — for example: “What are the current odds for this weekend's Premier League matches?”

Connect Claude

Web, desktop and mobile. Paste one URL.

  1. 1Copy your personal connector URL
  2. 2In Claude open Settings → Connectors → Add custom connector
  3. 3Paste the URL and click Add — done
Manual setup (config files, REST, Python) +

Claude Code

Adds the Sourcelane MCP server with your key as a header.

terminal
claude mcp add --transport http sourcelane https://api.usesourcelane.com/mcp \
  --header "Authorization: Bearer sl_live_your_agent_key"

Claude Desktop (config file)

Alternative to the connector URL: add to claude_desktop_config.json, then restart Claude.

claude_desktop_config.json
{
  "mcpServers": {
    "sourcelane": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://api.usesourcelane.com/mcp",
        "--header",
        "Authorization:${AUTH_HEADER}"
      ],
      "env": {
        "AUTH_HEADER": "Bearer sl_live_your_agent_key"
      }
    }
  }
}

Cursor & Windsurf

Add to ~/.cursor/mcp.json (or Windsurf's mcp_config.json).

mcp.json
{
  "mcpServers": {
    "sourcelane": {
      "url": "https://api.usesourcelane.com/mcp",
      "headers": {
        "Authorization": "Bearer sl_live_your_agent_key"
      }
    }
  }
}

VS Code

Save as .vscode/mcp.json. VS Code prompts for your key once.

.vscode/mcp.json
{
  "servers": {
    "sourcelane": {
      "type": "http",
      "url": "https://api.usesourcelane.com/mcp",
      "headers": {
        "Authorization": "Bearer ${input:sourcelane-key}"
      }
    }
  },
  "inputs": [
    {
      "type": "promptString",
      "id": "sourcelane-key",
      "description": "Sourcelane agent key",
      "password": true
    }
  ]
}

ChatGPT Custom GPT (Actions)

Create a GPT → Actions → Import from URL, then Authentication: API Key, Bearer.

OpenAPI schema URL
https://usesourcelane.com/openapi.json

REST

One POST. Pass maxResults to cap cost.

curl
curl -X POST https://api.usesourcelane.com/v1/call \
  -H "Authorization: Bearer sl_live_your_agent_key" \
  -H "Content-Type: application/json" \
  -d '{"listing":"mlb-stats-scraper","params":{"mode":"teams","maxItems":5},"maxResults":10}'

Python, LangChain, CrewAI, OpenAI Agents SDK…

Wrap the REST call as a tool, or point an MCP client at the endpoint.

python
import requests

res = requests.post(
    "https://api.usesourcelane.com/v1/call",
    headers={"Authorization": "Bearer sl_live_your_agent_key"},
    json={
        "listing": "mlb-stats-scraper",
        "params": {"mode":"teams","maxItems":5},
        "maxResults": 10,
    },
    timeout=300,
)
body = res.json()
print(body["receipt"]["chargedMicros"], "micro-USD for", body["receipt"]["results"], "results")
print(body["data"])

Reviews

—

0 reviews

5
0
4
0
3
0
2
0
1
0

Leave a review

Loading reviews…