Magisterial Python SDK
The official Python library for the Magisterial developer API — college sports data across NCAA D1/D2/D3, NAIA, and NJCAA: players, teams, rosters, cross-program careers, games, the live transfer portal, and an agent-backed natural-language query endpoint.
- Interactive API reference: https://api.magisterial.ai/v1/docs
- OpenAPI spec: https://api.magisterial.ai/v1/openapi.json
- Agent-ready one-file reference: https://api.magisterial.ai/v1/llms.txt
Installation
pip install magisterial
Requires Python 3.10+.
Usage
Create an API key at magisterial.ai/console/api-keys
and set MAGISTERIAL_API_KEY (or pass api_key= to the client).
from magisterial import Magisterial
client = Magisterial()
# Search players (auto-pagination follows the cursor for you)
page = client.players.search(
sport="soccer", division="D1,NAIA,NJCAA-D1", gender="women",
position="Forward", sort_by="goals",
)
for player in page.auto_paging_iter():
print(player.name, player.team, player.stats.get("goals"))
# One player's full profile
player = client.players.get(184223, sport="soccer", division="D3")
# Live transfer portal (usage-billed; use `since` for incremental polling)
portal = client.portal.list(sport="basketball", division="D1", status="INC")
# Natural-language query (usage-billed): submit and wait for the answer
run = client.query.create_and_poll(
prompt="Who led the NESCAC in assists this season?",
sport="soccer", division="D3", gender="men",
)
print(run.answer)
Async
Every method is mirrored on AsyncMagisterial:
import asyncio
from magisterial import AsyncMagisterial
async def main():
async with AsyncMagisterial() as client:
page = await client.players.search(sport="soccer", division="D1")
async for player in page.auto_paging_iter():
print(player.name)
asyncio.run(main())
Errors
Non-2xx responses raise typed exceptions carrying the API's error envelope:
from magisterial import Magisterial, NotFoundError, RateLimitError
client = Magisterial()
try:
client.players.get(1, sport="soccer", division="D1")
except NotFoundError as e:
print(e.error_code) # "player_not_found"
except RateLimitError as e:
print(e.retry_after) # seconds, from the Retry-After header
BillingError (402) means API billing is not enabled or the monthly budget is
exhausted — manage both in the developer console.
Retries
Idempotent requests (and players.search) are retried automatically on 429s,
5xx and connection failures — up to max_retries (default 2), honoring the
server's Retry-After. Billable creates (query.create, alerts.create)
are never retried automatically.
Types
All request/response models live in magisterial.types and are generated from
the published OpenAPI spec (scripts/sync-types.sh), so they cannot drift
from the live API contract.
License
MIT
Metadata
Release files for magisterial 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| magisterial-0.4.0.tar.gz | 40.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| magisterial-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 68.3 kB
Release files / magisterial-0.4.0.tar.gz
| Download URL | magisterial-0.4.0.tar.gz |
|---|---|
| Size | 40.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b644aa4b1fd6ac28d3d7f6e6c338ae2feb61b2bf534264357781f3f81e36d3e
|
|
BLAKE2b-256 checksum How to use checksums |
41b16fca16e7ad0f439d58fd17b1d080cfca12ca85e4a86d8a76840b23978f42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 12, 2026.
Transparency logRelease files / magisterial-0.4.0-py3-none-any.whl
| Download URL | magisterial-0.4.0-py3-none-any.whl |
|---|---|
| Size | 27.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e940a539809dad5a93e4e97cf63175aadb0c13bea696948ff9e3939bfa50c4f8
|
|
BLAKE2b-256 checksum How to use checksums |
2b69edb6798b76965e579d9129a94670e28b70873339d4ded8654bf5888d3477
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 12, 2026.
Transparency log