$npx skillfedfor your agent

pybaseball

Retrieve baseball data in Python

With conditionsPyPI LibrariesReleased Sep 2023290.7K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pybaseball-2.2.7-py3-none-any.whl
v2.2.7 · released 2023-09-08 · 11 runtime deps: numpy, pandas, beautifulsoup4, requests, lxml, pyarrow, pygithub, scipy

Yes, with conditions. Install if you need to work with MLB data and can tolerate occasional scraping breakage when target websites change. The low install friction, permissive MIT license, and stable dependency stack make it straightforward to add. However, the aging maintenance status (last release 2023-09-08) means you should verify that the specific data sources you need are still accessible before committing to it for production pipelines. No known security vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low install friction with a pure-Python wheel.
  • Maintenance status is aging—last release was 2023-09-08 and last commit 2026-01-04—but the repository remains active and unarchived with 1717 stars.
  • The 11 runtime dependencies (numpy, pandas, beautifulsoup4, requests, lxml, pyarrow, pygithub, scipy, matplotlib, tqdm, attrs) are all stable, widely-used libraries.

License · maintenance · safety

MIT (permissive) — MIT license is permissive, allowing commercial and private use with minimal restrictions. No licensing barrier to adoption.

last release 2023-09-08 (1071 days) · last repo commit 2026-01-04 · 1,717 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 290,653 downloads/mo, #7,985 on PyPI

Verify before relying

pip install pybaseball

from pybaseball import statcast, pitching_stats
data = statcast(start_dt="2019-06-24", end_dt="2019-06-25")
stats = pitching_stats(2014, 2016)
  • Whether scraped data remains current given that Baseball Reference, Savant, and FanGraphs may change their HTML/API structures without notice.
  • Performance characteristics when querying large date ranges or multiple seasons.
  • Whether the package handles rate-limiting or connection failures gracefully.
Same gist for agents: .md · .json

What it is and what it does

Pybaseball is a Python library that automates retrieval of Major League Baseball data from three major public sources: Baseball Reference, Baseball Savant, and FanGraphs. Instead of manually navigating websites or parsing HTML, you call functions to fetch statcast pitch-level data, season-level batting and pitching statistics, team standings, game schedules, and awards data as pandas DataFrames. The library handles web scraping using beautifulsoup4, requests, and lxml under the hood.

The package is designed for baseball analysts, researchers, and enthusiasts who want to work with MLB data programmatically. Data is available at multiple granularities: individual pitches (via statcast), per-player per-season aggregates (via pitching_stats and batting_stats), and custom time ranges. It integrates with pandas and numpy for downstream analysis, and supports matplotlib for visualization. The aging maintenance status means web scraping may occasionally break if target sites change their structure, but the core functionality remains useful for historical and recent data analysis.

Use it for

  • Retrieve pitch-level statcast data for a date range to analyze pitcher performance metrics like spin rate and release speed.
  • Pull multi-season batting or pitching statistics from FanGraphs for cohort analysis or player comparison studies.
  • Fetch a team's game-by-game schedule and results for a historical season to study win-loss patterns.
  • Query player-specific statcast data using playerid_lookup to build custom performance dashboards.
  • Combine standings data with schedule results to track division races and playoff implications over time.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, with conditions.

Install if you need to work with MLB data and can tolerate occasional scraping breakage when target websites change. The low install friction, permissive MIT license, and stable dependency stack make it straightforward to add. However, the aging maintenance status (last release 2023-09-08) means you should verify that the specific data sources you need are still accessible before committing to it for production pipelines. No known security vulnerabilities.

Install

pybaseball on PyPI

Before you install

Low install friction with a pure-Python wheel. Maintenance status is aging—last release was 2023-09-08 and last commit 2026-01-04—but the repository remains active and unarchived with 1717 stars. The 11 runtime dependencies (numpy, pandas, beautifulsoup4, requests, lxml, pyarrow, pygithub, scipy, matplotlib, tqdm, attrs) are all stable, widely-used libraries.

License in practice

MIT license is permissive, allowing commercial and private use with minimal restrictions. No licensing barrier to adoption.

Quickstart

pip install pybaseball

from pybaseball import statcast, pitching_stats
data = statcast(start_dt="2019-06-24", end_dt="2019-06-25")
stats = pitching_stats(2014, 2016)

Verify before relying

  • Whether scraped data remains current given that Baseball Reference, Savant, and FanGraphs may change their HTML/API structures without notice.
  • Performance characteristics when querying large date ranges or multiple seasons.
  • Whether the package handles rate-limiting or connection failures gracefully.

Package facts

LicenseMIT permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependencies
11 packages
numpypandasbeautifulsoup4requestslxmlpyarrowpygithubscipymatplotlibtqdmattrs
MaintenanceAging 1,071 days since the last release
Last repo commit
First released
Downloads290,653 / month, #7,985 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries

Evidence: pybaseball-2.2.7-py3-none-any.whl

Tags

Capabilities
baseball data scrapingstatcast data retrievalbaseball statistics analysismlb data pythonbaseball reference scrapersabermetrics datapitch-level baseball data
Topics
web-scrapingsports-analyticsdata-retrieval
PyPI keywords
baseballsabermetricsdatastatisticsstatcastwebscraping

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 › “baseball data scraping”

  • pybaseballScrapes baseball data from Baseball Reference, Baseball Savant, and…
  • MLB-StatsAPIProvides Python access to MLB's Stats API, allowing you to query…
  • 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 Libraries packages

urllib3 Worth it
PyPI · Libraries · released May 2026

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.

MITpure Python · 3.10+
1.8Bdownloads / mo
requests Worth it
PyPI · Libraries · released May 2026

Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.

Apache-2.0pure Python · 3.10+
1.8Bdownloads / mo
pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
python-dateutil Worth it
PyPI · Libraries · released Mar 2024

Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.

Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.

Apache-2.0pure Python
1.2Bdownloads / mo
six With conditions
PyPI · Libraries · released Dec 2024

Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.

MITpure Python
1.2Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.

MITpure Python · 3.10+
1.1Bdownloads / mo

See also MLB-StatsAPI · nba_api · nflreadpy · statsbombpy · nfl-data-py · fredapi · wbdata · runstats · ucimlrepo · pyreadstat