Skip to main content

onice

Python client and MCP server of the onice.dev API: advanced NHL statistics (Corsi, expected goals, on-ice numbers, lines and pairs, WOWY, goalies, RAPM, GAR and WAR) calculated from public NHL data. These are not official NHL numbers.

pip install onice

Get a free API key on https://onice.dev/developers/. The key is read from the environment variable ONICE_API_KEY, or give it to the client.

import onice

client = onice.Client("YOUR_KEY")

client.find_player("mcdavid")  # NHL ids by name
page = client.skaters(seasons="20252026", sit="5v5", sort="xgf_pct", limit=50)
page.data[0], page.cost, page.remaining  # rows, what the request cost, what is left

rows = client.rows("tables/skaters", seasons="20252026", sit="5v5", sort="xgf_pct", max_rows=3000)
frame = client.skaters(seasons="20252026", limit=100).to_pandas()  # needs pandas

Every endpoint of the API is a method named like its operation (client.tables_lines(...), client.player_profile(player_id=8478402)); client.operations lists them with their parameters, and the documentation is on https://onice.dev/docs/api/. A list is read page after page with client.rows(...) (one answer has at most 1000 rows).

What it costs

A request counts as one request of your quota for every started 100 rows it returns, times the seasons you ask for (up to 10). Result.cost tells what an answer cost and Result.remaining what is left; onice.estimate_cost(rows, seasons) counts it before you ask. Please credit onice.dev where you show the numbers.

Errors

AuthError (no or wrong key), BadRequestError (a parameter), NotFoundError, RateLimitError (too many requests in a minute: the client waits a short Retry-After by itself) and QuotaError (the quota is used up, or the request could cost more than what is left: ask for fewer rows or seasons). All are OniceError.

For AI assistants (MCP)

pip install "onice[mcp]"

or run it without installing, with uv: uvx onice-mcp. Settings of Claude Desktop, Cursor and others:

{
  "mcpServers": {
    "onice": {
      "command": "uvx",
      "args": ["onice-mcp"],
      "env": { "ONICE_API_KEY": "YOUR_KEY" }
    }
  }
}

The tools: find_player, skater_table, goalie_table, team_table, player_profile, player_percentiles, compare_players, glossary, methodology, data_status, list_endpoints and call_endpoint (any other endpoint). The server runs on your computer and spends the quota of your own key. Without uv: python -m onice.mcp_server.

Licence

The code of this client is MIT. The numbers belong to onice.dev and follow the terms of your plan.

Metadata

Release files for onice 0.1.0

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

Source distribution (sdist)

Source distribution for onice 0.1.0
File Size Uploaded Provenance Actions
onice-0.1.0.tar.gz 23.7 kB Without provenance Details for onice-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 50.6 kB

Release files / onice-0.1.0.tar.gz

Download URL onice-0.1.0.tar.gz
Size 23.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0c833b92bc7acfd859e4e14bf34c25abaa309e25894444c356c75f3b0912bde3
BLAKE2b-256 checksum
How to use checksums
8a2533e692f3d19d6a7acc847c3d7e9ec99b5119216c4e9acb60ade9f002f425
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / onice-0.1.0-py3-none-any.whl

Download URL onice-0.1.0-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa6ccad493856b7c9a5cffdb3ade754faf0c9dfddb1e0a82d4ab30172159806f
BLAKE2b-256 checksum
How to use checksums
0c476119c1c0a838c0050b929db7b238d9e8e608bb03ccd0b9b5048c7779b3aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for onice 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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