Skip to main content

Python client for the free SportScore sports-data API (football, basketball, cricket, tennis).

Project description

sportscore

Python client for the free SportScore sports-data API — live scores, match details, standings, top scorers, brackets and player stats across football, basketball, cricket and tennis.

PyPI version Python versions License: MIT

  • No API key. CORS-open. Free forever for reasonable usage (~10,000 req / 24h / IP).
  • Free in exchange for one thing: a visible "Powered by SportScore" dofollow backlink on any page that renders the data. Commercial / white-label (no attribution) available at sportscore.com/developers/terms/.
  • Sync + async, typed, py.typed shipped.

Install

pip install sportscore

Requires Python 3.9+.

Quickstart

Sync

from sportscore import SportScoreClient

with SportScoreClient() as sc:
    matches = sc.get_matches("football", limit=5)
    for m in matches["data"]:
        print(m["home_team"], m["score"], m["away_team"])

    standings = sc.get_standings("football", "premier-league")
    scorers = sc.get_top_scorers("football", "premier-league", limit=10)
    messi = sc.get_player("football", "lionel-messi")

    # Surface the free-tier attribution line anywhere you render the data:
    print(sc.attribution_html())
    # <a href="https://sportscore.com/" rel="dofollow" ...>Powered by SportScore</a>

Async

import asyncio
from sportscore import AsyncSportScoreClient

async def main():
    async with AsyncSportScoreClient() as sc:
        matches = await sc.get_matches("basketball", limit=3)
        print(matches)

asyncio.run(main())

API surface

Every method returns the parsed JSON body from the SportScore API. Non-2xx responses raise SportScoreError with status_code, body, and url attributes.

Method Description
get_matches(sport, limit=10) Live + recent matches for a sport
get_match_detail(sport, slug) Full data for one match
get_team_schedule(sport, slug, limit=10) Team fixtures (past + upcoming)
get_standings(sport, slug) League / competition table
get_top_scorers(sport, slug, limit=20, stat="goals") Top scorers or assisters
get_player(sport, slug) Player stats + metadata
get_bracket(sport, slug) Knockout tournament bracket
get_tracker(sport, match_id) Live match tracker (football)

sport is one of "football", "basketball", "cricket", "tennis".

Configuration

SportScoreClient(
    api_base="https://sportscore.com",
    user_agent="my-app/1.0",
    timeout=15.0,
    http_client=None,  # pass your own httpx.Client if you want pooling
)

No API keys, no required env vars.

Anonymous install-ping (opt-out)

On the first SportScoreClient() instantiation per process, the library fires one fire-and-forget POST to https://sportscore.com/api/mcp/ping/ on a background thread:

{
  "client": "sportscore-py",
  "version": "0.2.0",
  "transport": "python",
  "host": "linux",
  "python": "3.12.1"
}

That's the whole payload — no user id, no IP, no cookies, no per-call telemetry. We use it to see rough weekly-active-installs and Python/OS spread so we know what to support. The ping runs on a daemon thread and has a 3 s timeout — it cannot delay your program.

Opt out by setting SPORTSCORE_NO_TELEMETRY=1 in your environment:

export SPORTSCORE_NO_TELEMETRY=1

Attribution — how the free tier works

The service is free in exchange for a visible dofollow backlink to https://sportscore.com/ on any page that renders the returned data. The client ships helpers so the one line of code you need is literally one line:

client.attribution_html()
# <a href="https://sportscore.com/" rel="dofollow" title="Sports data by SportScore">Powered by SportScore</a>

Prefer a pre-designed badge? Pick any of the six variants (dark pill, light pill, minimal, tiny circle, amber accent, stat-block footer) at sportscore.com/developers/#badges.

Full terms: sportscore.com/developers/terms/.

Commercial / white-label removal: api@sportscore.com.

Error handling

from sportscore import SportScoreClient, SportScoreError

with SportScoreClient() as sc:
    try:
        sc.get_standings("football", "made-up-league")
    except SportScoreError as exc:
        print(exc.status_code, exc.body)

Related projects

  • sportscore-mcp — the same 8-tool surface exposed as a Model Context Protocol server for Claude, Cursor, Zed, etc.
  • OpenAPI spec — full REST spec if you'd rather skip the client altogether.
  • Interactive API reference — Redoc-rendered docs with live "Try it" for every endpoint.

Contributing

Bugs, PRs, and example code all welcome: github.com/Backspace-me/sportscore-py.

Run the tests:

pip install -e ".[dev]"
pytest

License

MIT — client code. Remote API usage is governed by the SportScore API Terms of Use.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sportscore-0.2.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sportscore-0.2.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file sportscore-0.2.0.tar.gz.

File metadata

  • Download URL: sportscore-0.2.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sportscore-0.2.0.tar.gz
Algorithm Hash digest
SHA256 207256395014d9916c29d74c4cafef4a590877a239192d3dab0632e9622a9e5f
MD5 6f08374f49e28c94da66513d72878ab0
BLAKE2b-256 ceb66a257c702f3a5a42f8fe017faf0e72ebe3b6cd71b8de7abeb807c954bf32

See more details on using hashes here.

Provenance

The following attestation bundles were made for sportscore-0.2.0.tar.gz:

Publisher: publish.yml on Backspace-me/sportscore-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sportscore-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: sportscore-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sportscore-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ef13542a20852511f69483005338ad54888a06f74711147d40b09d5b4ed6a7c
MD5 bfaf6d23b83398c911ccace2138e8771
BLAKE2b-256 e1bcad74bdef520f7ec47bd156e9ca32a3ff71a3a42d7f0f6346b5a545671598

See more details on using hashes here.

Provenance

The following attestation bundles were made for sportscore-0.2.0-py3-none-any.whl:

Publisher: publish.yml on Backspace-me/sportscore-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page