Extract API and CLI references into dedicated files: - SKILL.md (173 lines): routing, safety rules, architecture, common queries - API_REFERENCE.md (99 lines): endpoints, auth, Python client - CLI_REFERENCE.md (115 lines): commands, flag ordering, compliance workflow Total content reduced from 1005 to 387 lines. Context loaded per session drops from 1005 to 173 lines. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3.5 KiB
3.5 KiB
Major Domo - API Reference
Authentication
All write operations require Bearer token:
export API_TOKEN='your-token-here'
Environments
- Production:
https://api.sba.manticorum.com/v3/ - Development:
http://10.10.0.42:8000/api/v3/
export DATABASE='prod' # or 'dev'
Endpoints
Current Status
GET /current- Current season/week statusGET /current?season={N}- Specific season statusPATCH /current/{id}- Update status (private)
Players
GET /players?season={N}- List all players in seasonGET /players?team_id={id}- Players by teamGET /players?name={name}- Players by name (exact)GET /players/search?q={query}- Fuzzy searchGET /players/{id}- Single playerPATCH /players/{id}- Update player (private)
Teams
GET /teams?season={N}- List teamsGET /teams?team_abbrev={abbrev}- By abbreviationGET /teams?active_only=true- Active teams onlyGET /teams/{id}- Single teamGET /teams/{id}/roster/{which}- Roster (current/next)
Standings
GET /standings?season={N}- All standingsGET /standings?season={N}&division_abbrev={div}- By divisionGET /standings/team/{team_id}- Single teamPOST /standings/s{season}/recalculate- Recalculate (private)
Transactions
GET /transactions?season={N}- List transactionsGET /transactions?season={N}&team_abbrev={abbrev}- By teamGET /transactions?season={N}&week_start={W}&week_end={W}- By week rangePATCH /transactions/{move_id}- Update (private)
Statistics (Advanced Views)
GET /views/season-stats/batting?season={N}- Season batting- Params:
team_id,player_id,min_pa,sort_by,sort_order,limit,offset
- Params:
GET /views/season-stats/pitching?season={N}- Season pitching- Params:
team_id,player_id,min_outs,sort_by,sort_order,limit,offset
- Params:
POST /views/season-stats/batting/refresh- Refresh batting (private)POST /views/season-stats/pitching/refresh- Refresh pitching (private)
Other Endpoints
/api/v3/schedules- Game scheduling/api/v3/results- Game results/api/v3/injuries- Injury tracking/api/v3/awards- League awards/api/v3/managers- Manager profiles/api/v3/divisions- Division info/api/v3/draftdata- Draft status/api/v3/draftpicks- Pick ownership/api/v3/draftlist- Draft priority lists/api/v3/keepers- Keeper selections/api/v3/stratgame- Game data/api/v3/stratplay- Play-by-play/api/v3/sbaplayers- Player pool/api/v3/custom_commands- Custom Discord commands/api/v3/help_commands- Static help text
Python API Client
from api_client import MajorDomoAPI
api = MajorDomoAPI(environment='prod', verbose=True)
# Or: api = MajorDomoAPI(environment='dev', token='your-token')
# Common operations
current = api.get_current()
team = api.get_team(abbrev='CAR')
player = api.get_player(name='Mike Trout', season=12)
results = api.search_players(query='trout', season=12, limit=10)
roster = api.get_team_roster(team_id=42, which='current')
standings = api.get_standings(season=12, division_abbrev='ALE')
transactions = api.get_transactions(season=12, team_abbrev='CAR')
batting = api.get_season_batting_stats(season=12, min_pa=100, sort_by='woba', limit=50)
pitching = api.get_season_pitching_stats(season=12, min_outs=150, sort_by='era', limit=50)
OpenAPI docs: http://10.10.0.42/api/docs
Router source: /mnt/NV2/Development/major-domo/database/app/routers_v3/