L Laquid
API v2 · stable

Quickstart

Last reviewed 2026-11-14 · applies to API v2.4.x

Three steps: provision a key pair, sign a request, read the response. There is no SDK requirement — the interface is plain HTTP/1.1 or HTTP/2 with JSON bodies.

1. Provision credentials

Keys are issued per environment. A sandbox key returns synthetic series drawn from the same generator used in backtests, so response shapes are identical but values are not live.

Store the pair on disk with restrictive permissions and read it at run time. Do not inline it in a script or pass it on a command line, where it would appear in the process list:

# One-time setup, in the shell of the account that owns the pipeline
mkdir -p "$HOME/.laquid" && chmod 700 "$HOME/.laquid"
$EDITOR "$HOME/.laquid/key_id"      # public identifier, mode 600
$EDITOR "$HOME/.laquid/signing_key"      # secret, mode 600
chmod 600 "$HOME/.laquid/key_id" "$HOME/.laquid/signing_key"
Secret handling. The secret is shown once at creation time and is stored server-side as a salted SHA-256 digest. If it is lost, rotate the pair — there is no recovery path. See Rotation.

2. Sign the request

The signature covers the HTTP method, the canonical path, the query string, and a Unix timestamp. Construct it as follows:

payload   = METHOD + "\n" + PATH_WITH_QUERY + "\n" + TIMESTAMP + "\n" + SHA256_HEX(BODY)
signature = HEX( HMAC_SHA256( SECRET, payload ) )

Send all three headers:

X-Laquid-Key:       lq_id_4f8c2a91d7e0
X-Laquid-Timestamp: 1795765314
X-Laquid-Signature: <64 lowercase hex characters>

A working shell helper, roughly twelve lines, is included on the Authentication page. Requests with a timestamp more than 300 seconds from server time are rejected with 401 signature_expired.

3. Verify the response

Successful responses carry 200 and a JSON body. Every response includes these headers:

HeaderMeaning
X-Laquid-SnapshotIdentifier of the data snapshot the response was resolved against
X-Laquid-Quota-RemainingRequests left in the current window
X-Laquid-Quota-ResetUnix timestamp when the window rolls over
X-Request-IdStable identifier; quote this in support requests

Choosing a transport

HTTP/2 is enabled on the public edge and is the better choice for pipelines that issue many small sequential requests: header compression alone typically saves 20–40 % of bytes on paginated sweeps. HTTP/1.1 with keep-alive is fully supported and is a reasonable default for batch jobs.

Sanity check. A correctly signed request to GET /api/v2/rates/latest?symbols=AAA.XNGS in the sandbox returns exactly one rate object. If you get an empty array, the symbol namespace is usually wrong — venue suffixes are mandatory.

Avoiding the common mistakes

  1. Signing the raw body instead of its digest. The payload includes the SHA-256 hex of the body, not the body itself.
  2. Re-sorting query parameters. Sign the query string exactly as transmitted.
  3. Reusing a signature. Timestamps are single-use within the freshness window.
  4. Assuming constant latency. Consolidation cadence affects tail latency more than load does.
  5. Trimming the trailing newline. The canonical payload has no trailing newline; most bugs here come from echo where printf was needed.