MLB-StatsAPI
MLB Stats API Wrapper for Python
Decision gist · record as of 2026-08-14
Yes, if you need programmatic access to MLB data. Low install friction, active maintenance, no known vulnerabilities, and a single lightweight dependency make it straightforward to adopt. The GPLv3 license requires that any derivative work also be open-source, so verify that aligns with your project's licensing model before committing.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction installation with a single runtime dependency (requests).
- Active maintenance with recent commits and steady development history since 2019-04-26.
License · maintenance · safety
copyleft license (copyleft) — Licensed under GPLv3 (copyleft). Any derivative work or modification must also be released under GPLv3; redistribution requires source code availability.
last release 2025-04-04 (497 days) · last repo commit 2026-06-02 · 841 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 137,837 downloads/mo, #11,354 on PyPI
Alternatives
Verify before relying
pip install mlb-statsapi
import statsapi
# Fetch game data
games = statsapi.schedule(start_date='2025-04-04', end_date='2025-04-04')- Whether the package supports querying historical data beyond the current season
- Rate limiting or throttling behavior when making repeated API calls
- Specific Python version compatibility (requires_python is unspecified)
What it is and what it does
MLB-StatsAPI is a Python wrapper around MLB's public Stats API that lets you programmatically retrieve baseball data—games, scores, player stats, team information, and more. It abstracts away the HTTP details by wrapping requests, so you can focus on querying the data you need rather than building API calls manually.
The package is maintained actively with recent development and has a straightforward install with minimal dependencies. It's designed for developers building baseball-related applications, data analysis tools, or dashboards that need live or historical MLB information. Note that this is an unofficial wrapper; data usage is subject to MLB's terms, and the package is not affiliated with MLB or any MLB team.
Use it for
- Build a dashboard or web app that displays live MLB game scores and standings
- Analyze historical player statistics or team performance across seasons
- Create alerts or notifications for specific teams, players, or game outcomes
- Populate a database with MLB data for research or fantasy baseball applications
- Integrate MLB data into a sports news or stats aggregation tool
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need programmatic access to MLB data.
Low install friction, active maintenance, no known vulnerabilities, and a single lightweight dependency make it straightforward to adopt. The GPLv3 license requires that any derivative work also be open-source, so verify that aligns with your project's licensing model before committing.
Install
mlb-statsapi on PyPI
Before you install
Low friction installation with a single runtime dependency (requests). Active maintenance with recent commits and steady development history since 2019-04-26.
License in practice
Licensed under GPLv3 (copyleft). Any derivative work or modification must also be released under GPLv3; redistribution requires source code availability.
Quickstart
pip install mlb-statsapi
import statsapi
# Fetch game data
games = statsapi.schedule(start_date='2025-04-04', end_date='2025-04-04')
Verify before relying
- Whether the package supports querying historical data beyond the current season
- Rate limiting or throttling behavior when making repeated API calls
- Specific Python version compatibility (requires_python is unspecified)
Package facts
| License | copyleft license copyleft |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagerequests |
| Maintenance | Actively maintained 497 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 137,837 / month, #11,354 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: GNU General Public License v3 (GPLv3)Operating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 |
Evidence: mlb_statsapi-1.9.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “MLB baseball statistics API”
- MLB-StatsAPIProvides Python access to MLB's Stats API, allowing you to query…
- pybaseballScrapes baseball data from Baseball Reference, Baseball Savant, and…
- espn-apiExtracts league, team, and player data from ESPN's Fantasy API for…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also nba_api · pybaseball · pypistats · espn-api · nflreadpy · nfl-data-py · statsbombpy · runstats · spotapi · mattermostwrapper