Skip to main content

itscalledsoccer


standard-readme compliant PyPI Version PyPI - Python Version Python tests License: MIT PyPI download month OpenSSF Baseline codecov

Table of Contents


Background

itscalledsoccer is a Python wrapper around the American Soccer Analysis API, providing programmatic access to advanced soccer analytics across North American leagues.

What you can measure:

  • Expected Goals (xG) — Shot quality and finishing efficiency
  • Expected Passes (xPass) — Pass difficulty and creative play
  • Goals Added (g+) — Total value contribution of players
  • Salaries — MLS salary and spend data

The API is free and public — no authentication required.

Data returned by this API is licensed under CC BY-SA 4.0.

Supported leagues:

Code League
mls Major League Soccer
nwsl National Women's Soccer League
uslc USL Championship
usl1 USL League One
usls USL Super League
nasl North American Soccer League (historical)
mlsnp MLS Next Pro

Useful links:


Features

  • 15 API methods covering players, teams, games, and advanced statistics
  • Substring name matching — search by partial names or abbreviations ("LA", "Vela")
  • Type hints — full type annotations on all public methods
  • Consistent interface — same patterns across all 7 leagues

Installation

Stable Release

pip install itscalledsoccer

Development Version

git clone https://github.com/American-Soccer-Analysis/itscalledsoccer.git
cd itscalledsoccer
pip install -e ".[dev]"

Requirements: Python 3.10+, requests, polars, cachecontrol, pydantic


Quick Start

from itscalledsoccer import AmericanSoccerAnalysis

# Initialize client (no authentication required)
asa = AmericanSoccerAnalysis()

# Get all USLC players
uslc_players = asa.get_players(leagues="uslc")

# Get Expected Goals (xG) data for 2023
xg_data = asa.get_player_xgoals(
    leagues="uslc",
    season_name="2023"
)

For the complete method reference, see Usage Examples below.


Usage Examples

Entities

Retrieve core soccer entities with optional filtering:

# Same interface for all entity types
uslc_players = asa.get_players(leagues="uslc")
teams = asa.get_teams(leagues=["uslc", "nwsl"])
stadia = asa.get_stadia()
managers = asa.get_managers(leagues="uslc")
referees = asa.get_referees(leagues=["uslc", "mls"])

Available entities: players, teams, stadia, managers, referees


Games

# Get games for a specific league and season
uslc_2024_games = asa.get_games(leagues="uslc", seasons="2024")

# Filter by team
lou_games = asa.get_games(leagues="uslc", team_names="Louisville City")

Player Statistics

Expected Goals (xG)

Expected Goals measures the quality of shot chances a player creates or faces.

xg = asa.get_player_xgoals(
    leagues="uslc",
    season_name="2025",
    minimum_minutes=900
)

Available filters: minimum_minutes, minimum_shots, minimum_key_passes, shot_pattern, split_by_teams, split_by_seasons, split_by_games, general_position

Expected Pass (xPass)

Expected Pass measures pass difficulty and creative play value.

xpass = asa.get_player_xpass(
    leagues="uslc",
    minimum_minutes=900
)

Goals Added (g+)

Goals Added measures total value contribution across all actions.

gplus = asa.get_player_goals_added(
    leagues="uslc",
    above_replacement=True
)

Note: Goalkeeper statistics use the same interface — get_goalkeeper_xgoals() and get_goalkeeper_goals_added().


Team Statistics

# Team Expected Goals
team_xg = asa.get_team_xgoals(
    leagues="uslc",
    split_by_seasons=True
)

# Team Expected Pass
team_xpass = asa.get_team_xpass(
    leagues=["uslc", "nwsl"],
    split_by_seasons=True
)

# Team Salaries (MLS only)
team_salaries = asa.get_team_salaries(
    leagues="mls",
    split_by_teams=True
)

Team-specific filters: home_only, away_only, home_adjusted, even_game_state, zone (1-30), gamestate_trunc (-2 to 2)


Advanced Usage

Substring Name Matching

Search by case-insensitive substrings. Returns the first matching entity:

# Player names
asa.get_players(names="Carlos Vela")

# Team names
asa.get_teams(names="LA")

API Reference

Complete documentation: american-soccer-analysis.github.io/itscalledsoccer/reference

The reference includes:

  • All 15 methods and their parameters
  • Complete field descriptions for each endpoint
  • Type signatures and defaults

Common questions:

  • No API key needed? Correct — the API is public and free.
  • Why is my query slow? Large queries may take a moment. Subsequent identical queries are cached.
  • What do the metrics mean?
    • xG: Shot quality (0-1 per shot)
    • xPass: Pass completion probability (0-1)
    • g+: Measures a player's total on-ball contribution in attack and defense

For detailed methodology, see American Soccer Analysis.


Other Versions


Contributing

See CONTRIBUTING.md for code of conduct, development setup, pull request process, and issue reporting.


License

MIT © itscalledsoccer authors

Metadata

Release files for itscalledsoccer 2.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for itscalledsoccer 2.4.1
File Size Uploaded Provenance Actions
itscalledsoccer-2.4.1.tar.gz 21.2 kB With provenance Details for itscalledsoccer-2.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for itscalledsoccer 2.4.1
File Interpreter ABI Platform Actions
itscalledsoccer-2.4.1-py3-none-any.whl Python 3 none any Details for itscalledsoccer-2.4.1-py3-none-any.whl

Total release size: 35.5 kB

Release files / itscalledsoccer-2.4.1.tar.gz

Download URL itscalledsoccer-2.4.1.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
841a26eb0e6be01bedb32b6f3d02fb70f9fa27438cafa8c189d13b4f87a0c64c
BLAKE2b-256 checksum
How to use checksums
62dabc28104ea0c5c78876766e05324d81877183dcd67749f393f6c5cce90f2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / itscalledsoccer-2.4.1-py3-none-any.whl

Download URL itscalledsoccer-2.4.1-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0db60676b136c679a0432f88dcd00f13d98805fa62cc78c4a10c2f8e14dff545
BLAKE2b-256 checksum
How to use checksums
05944a9b2f69f5b04fb44089805f2a589ed05d2b9d8d353c16512586a13b98ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for itscalledsoccer 2.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for itscalledsoccer-2.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page