XQL Overview
A query language for screening instruments programmatically.
XQL (XCREENER Query Language) is the language behind every screener on XCREENER, and it's also available directly to developers: write a query, send it to the API or an MCP client, and get back matching instruments.
A query has two parts: a header of pragmas (market, timeframe, columns, sort, limit) and a core-logic body: a boolean expression that decides whether an instrument matches.
market = "CRYPTO"
timeframe = h1
columns = [close, rsi(14)]
sort = rsi(14) asc
rsi(14) < 30 and close > d::sma(200)This query says: on the crypto market's hourly timeframe, find instruments where the 14-period RSI is below 30 (short-term oversold) and price is above the daily 200-period moving average (long-term uptrend): d::sma(200) reaches across to the daily timeframe even though the query's default is hourly. Matches return close and rsi(14), sorted by RSI ascending.
Mental Model
- Series (
close,open,high,low,volume) and indicator functions (rsi,sma,macd_line, …) produce numeric values. - Comparators (
<,>,==, …) and logical operators (and,or,not) combine them into a boolean condition: the core-logic body. <timeframe>::qualifiers (e.g.d::) and[-N]offsets let any value expression reach across timeframes or back in time.letbindings name an intermediate expression so you can reuse or offset-index it.- Every query is checked against a 300-bar lookback ceiling before it runs: a query asking for more history than that is rejected up front, not silently truncated.
Where to Go Next
Language Reference
Grammar, operators, the full function catalog, timeframes, offsets, and let bindings.
HTTP API
Call /xql/validate, /xql/explain, and /xql/run directly, with API key
authentication.
MCP
Connect Claude Desktop, Claude Code, or any MCP client to run XQL queries as tools.
Cookbook
Worked examples: momentum, volatility, volume, multi-timeframe, and full queries.