Skip to main content

Query parameters reference

This page documents the parameters accepted by the query function across all CloudQuant Data Liberator SDKs. Parameter names are consistent across languages; only the types and calling conventions differ. At least one of the following is required for every query:
  • A dataset via name or a raw sql statement.
  • A time anchor: back_to, as_of, max_lookback (LKV mode), or record_limit (N-Query mode).
Unknown parameters are rejected by the server when strict validation is enabled (the default).

Time range parameters

For LKV mode, omit back_to and use as_of (or the default “now”) together with max_lookback. For N-Query mode, provide either as_of (backward) or back_to (forward) along with record_limit.

Date format

Datetime strings use the format YYYY-MM-DD HH:MM:SS (the time portion is optional). When the time portion is omitted, 00:00:00 is assumed — for example, as_of: "2023-01-15" is interpreted as as_of: "2023-01-15 00:00:00". If as_of and back_to are identical, the result is a single point rather than a time series.

Dataset & symbol parameters

Custom WHERE filters

The where parameter adds extra predicates on top of the time-range and symbol filters CloudQuant Data Liberator generates automatically. The value is appended as AND (<your clause>) to the internal query.
For multi-key datasets (e.g. concordance tables with a dataset column), where can filter on columns beyond symbol:

Raw SQL

The sql parameter accepts a complete SQL SELECT and bypasses automatic query construction. Use it when you need direct control over joins, subqueries, or complex predicates.

Requirements

Parameters allowed with sql

When sql is supplied, only auth, transfer, and cache options may accompany it. Non-empty construction parameters (name, back_to, as_of, where, fields, etc.) raise an error. Allowed alongside sql: user, system, token, compress, json_xfer, batch_size, debug_stream, force_regen, dependent_partition_name, skip_validation, skip_discovery, symbols, symbol_key_sequences, data_key_column.
Do not combine sql with name, where, back_to, as_of, or other query-construction parameters. Choose parameter-based queries or raw SQL, not both.

Query limits & ordering

N-query mode

N-Query mode is activated by supplying a non-zero record_limit.
  • Anchor: Backward N-Query uses as_of (exclusive); forward N-Query uses back_to (inclusive). Exactly one anchor is required.
  • Per-symbol vs global: A negative record_limit returns up to N records per symbol; a positive value returns N records total, distributed by recency.
  • Compatibility: N-Query works with both single-dataset and superquery queries. When both as_of and back_to are set, record_limit is ignored and a standard time-range query is executed.

Superquery parameters

A superquery is triggered when name is a list of dataset names. It merges and resamples data from multiple datasets into a single result.

Column-level aggregate aliases

Record-level aggregates (last_timestamp, first_timestamp) apply to the entire dataset per bucket. Output columns are named {dataset}_{column}_{alias} (e.g. trades_price_o, trades_volume_s) for column-level aggregates, and {dataset}__first_timestamp / {dataset}__last_timestamp for record-level aggregates. Dict format example:

Authentication & authorization

The user and token parameters can be provided per-query or configured once at the SDK level:
  • Python: Set via the liberator.json file in your working directory.
  • JavaScript: Use liberator.set_default("query", credentials) to avoid passing them every time.
  • RESTful: Include in each request’s JSON body.
  • Other SDKs: Loaded from liberator.json in the working directory.

Connection & transfer

Cache & derived data

Streaming & debug

SDK connection options

These options configure the SDK client rather than the query itself.

Example queries

Basic time-range query

LKV (last-known-value) query

N-query: most recent 200 records (backward from as_of)

N-query: first 200 records (forward from back_to)

N-query per-symbol (negative limit)

Superquery with aggregates

Raw SQL

Parameter-based query with where