The Archive
Query Reference
Every queryable field in the Vault archive, plus worked examples to build from.
Query Syntax
Queries are condition-first, such as team=Mets and line>0 or starter='Grayson Rodriguez' and site='away'. The app infers the minimal team or starter grouping; explicit team@conditions remains valid. Prefix any field with o: for the opponent, p: for the team's previous game, or op: for the opponent's previous game.
Official SDQL Manual Reference
Definitions taken verbatim from the SportsDataBase / KillerSports manuals — this is the spec our query engine matches.
Game references (prefixes)
(none)The team, in the game in question.t:The team (optional — same as no prefix).o:The team's opponent in this game.p:The team's previous game. Does NOT cross seasons.pp:, ppp:Two, three… games back. Stack more p’s to go further.P:The team's previous game vs THIS opponent (revenge). DOES cross seasons.n:, N:The team's next game / next match-up vs this opponent.s:MLB only — the starter's last start.S:MLB only — the starter's last start vs this opponent.po:Opponent in the team's previous game (i.e. what the team allowed).op:The opponent's previous game.opo:The opponent's previous opponent.so:The opponent in the starter's last start (MLB).P:season=seasonRestrict revenge to the same season.Letter shortcuts
Hsite='home'Asite='away'Wthe team wonLthe team lostFfavorite — NFL/NBA: line<0 · MLB: line<-105 (a pick is both teams at -105)Dunderdog — line>0Cconference/league game: conference=o:conference (use "not C" for interleague)HF, AD, HD, AFhome favorite, away dog, home dog, away favoritep:LHF, p:ALF, p:WADletters stack: loss as home favorite, away loss as favorite, win as away dogDIV / NDIV (ND)division=o:division / not division=o:divisionREG / POplayoffs=0 / playoffs=1 (default includes both)WPwin percentage entering the game, 0–100 (a .500 team is 50)Averages & sums
tA(points)Team season-to-date average — short for Average(points@team and season).oA(turnovers)Opponent's season-to-date average.tS(margin>=10,N=4)Sum/count over the last N games.Average(points@team and season and H, N=3)Average over the last 3 home games.Min / Max / R (Replace)Other aggregators.tA(line,N=3) is not NoneAggregators return None when there is no data — use is / is not.Good to know
- • Date format is YYYYMMDD (20060610). Season is the year the season starts.
- • Parameters can be compared and combined with + - * / and parentheses: o:hits >= hits + 5.
- • Lists behave like Python lists: inning runs[0], sum(inning runs[:5]), sorted(list:p:hits)[-3].
- • Leaving a parameter unset ("and team") runs the query for every value of it.
- • A quality start (MLB QS) is 6+ innings and 3 or fewer earned runs.
Team & Score
teamTeam name/abbreviationo:teamOpponent team name/abbreviationrunsRuns scored by the teamo:runsRuns scored by the opponenthitsTeam hitso:hitsOpponent hitsmarginRun differential (team − opponent)site'home' or 'away'Betting Lines
lineMoneyline odds for the teamtotalOver/under total for the gameats marginRun-line-adjusted margin (vs the spread)ou marginCombined runs minus the total (over/under margin)Game Info
dateGame date, in YYYYMMDD formattimeScheduled start timeday1 = day game, 0 = night gameseasonSeason yearleague'AL' or 'NL'division1 = division game, 0 = non-divisionseries gameGame number within the current seriesseries gamesTotal games in the current seriesr11 if a run scored in the 1st inning, else 0Starting Pitchers
starterTeam's starting pitcherstarter throws'L' or 'R' — team starter's throwing hando:starterOpponent's starting pitchero:starter throws'L' or 'R' — opponent starter's throwing handquality start1 if the starter recorded a quality startstarter restDays of rest for the starterSituational
streakCurrent win/loss streak (negative = losing streak)scored first1 if the team scored firstPrior Game Prefixes
p:<field>Team's value from its previous game, e.g. p:margin, p:runsop:<field>Opponent's value from its previous gameShortcuts
No custom shortcut tokens are defined right now — keywords like AD, H, and V already work as-is. String values left unquoted (e.g. team=Phillies) are automatically wrapped in quotes for you.
Worked Examples
Home underdogs
team,o:team,points,o:points,line,total @ H and DConference underdogs
team,o:team,points,o:points,line,total @ DIV and DNon-conference favorites
team,o:team,points,o:points,line,total @ NDIV and FOff a failed cover
team,o:team,points,o:points,line,total @ p:margin+p:line<0Off two failed covers
team,o:team,points,o:points,line,total @ p:margin+p:line<0 and pp:margin+pp:line<0Off back-to-back losses
team,o:team,points,o:points,line,total @ p:L and pp:LOff a bye
team,o:team,points,o:points,line,total @ rest>=13Vs opponent off a bye
team,o:team,points,o:points,line,total @ o:rest>=13Ranked vs unranked
team,o:team,points,o:points,line,total @ rank<26 and o:rank>25Vs a ranked opponent
team,o:team,points,o:points,line,total @ o:rank<26Week 1
team,o:team,points,o:points,line,total @ week=1Fade 21+ point favorites
team,o:team,points,o:points,line,total @ line<=-21Home dog, 60+ total
team,o:team,points,o:points,line,total @ H and line>=3 and total>=60