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 won
Lthe team lost
Ffavorite — NFL/NBA: line<0 · MLB: line<-105 (a pick is both teams at -105)
Dunderdog — line>0
Cconference/league game: conference=o:conference (use "not C" for interleague)
HF, AD, HD, AFhome favorite, away dog, home dog, away favorite
p:LHF, p:ALF, p:WADletters stack: loss as home favorite, away loss as favorite, win as away dog
DIV / NDIV (ND)division=o:division / not division=o:division
REG / 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/abbreviation
o:teamOpponent team name/abbreviation
runsRuns scored by the team
o:runsRuns scored by the opponent
hitsTeam hits
o:hitsOpponent hits
marginRun differential (team − opponent)
site'home' or 'away'
Betting Lines
lineMoneyline odds for the team
totalOver/under total for the game
ats marginRun-line-adjusted margin (vs the spread)
ou marginCombined runs minus the total (over/under margin)
Game Info
dateGame date, in YYYYMMDD format
timeScheduled start time
day1 = day game, 0 = night game
seasonSeason year
league'AL' or 'NL'
division1 = division game, 0 = non-division
series gameGame number within the current series
series gamesTotal games in the current series
r11 if a run scored in the 1st inning, else 0
Starting Pitchers
starterTeam's starting pitcher
starter throws'L' or 'R' — team starter's throwing hand
o:starterOpponent's starting pitcher
o:starter throws'L' or 'R' — opponent starter's throwing hand
quality start1 if the starter recorded a quality start
starter restDays of rest for the starter
Situational
streakCurrent win/loss streak (negative = losing streak)
scored first1 if the team scored first
Prior Game Prefixes
p:<field>Team's value from its previous game, e.g. p:margin, p:runs
op:<field>Opponent's value from its previous game
Shortcuts

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 underdogsteam,o:team,points,o:points,line,total @ H and D
Conference underdogsteam,o:team,points,o:points,line,total @ DIV and D
Non-conference favoritesteam,o:team,points,o:points,line,total @ NDIV and F
Off a failed coverteam,o:team,points,o:points,line,total @ p:margin+p:line<0
Off two failed coversteam,o:team,points,o:points,line,total @ p:margin+p:line<0 and pp:margin+pp:line<0
Off back-to-back lossesteam,o:team,points,o:points,line,total @ p:L and pp:L
Off a byeteam,o:team,points,o:points,line,total @ rest>=13
Vs opponent off a byeteam,o:team,points,o:points,line,total @ o:rest>=13
Ranked vs unrankedteam,o:team,points,o:points,line,total @ rank<26 and o:rank>25
Vs a ranked opponentteam,o:team,points,o:points,line,total @ o:rank<26
Week 1team,o:team,points,o:points,line,total @ week=1
Fade 21+ point favoritesteam,o:team,points,o:points,line,total @ line<=-21
Home dog, 60+ totalteam,o:team,points,o:points,line,total @ H and line>=3 and total>=60