Skip to main content
Read data by sending a GET request to any path with .json appended.

Basic read

curl 'https://chess-app.larkdb.net/my-game/players/alice.json'
Response:
{
  "name": "Alice",
  "score": 250,
  "online": true
}
If the path doesn’t exist, the response is null.

Shallow reads

For large datasets, you often don’t need the entire subtree. Add shallow=true to get only the immediate children without recursing into them:
curl 'https://chess-app.larkdb.net/my-game/players.json?shallow=true'
By default, shallow reads replace every child with true. You see which keys exist, but nothing about their values or size:
{
  "alice": true,
  "bob": true,
  "carol": true
}

Enhanced shallow reads

Add v=2 for a more useful shallow response. With v=2, primitive values (strings, numbers, booleans) are returned as-is, and container objects are returned as {".sz": N} where N is the size in bytes:
curl 'https://chess-app.larkdb.net/my-game/.json?shallow=true&v=2'
{
  "players": {".sz": 4096},
  "settings": "dark",
  "playerCount": 42,
  "active": true
}
This tells you a lot more at a glance. players is an object containing ~4 KB of data, while settings, playerCount, and active are leaf values you can read directly. Useful for exploring an unfamiliar database or deciding which subtrees are worth fetching in full.
Without v=2, the response above would be {"players": true, "settings": true, "playerCount": true, "active": true}, with no way to tell which children are containers and which are primitives.

Querying

Filter and sort data using query parameters. These map directly to the query methods available in the SDKs.

Order by

Specify a sort order with orderBy:
# Order by a child key
curl 'https://chess-app.larkdb.net/my-game/players.json?orderBy="score"'

# Order by key
curl 'https://chess-app.larkdb.net/my-game/players.json?orderBy="$key"'

# Order by value (for lists of primitives)
curl 'https://chess-app.larkdb.net/my-game/highscores.json?orderBy="$value"'

# Order by priority
curl 'https://chess-app.larkdb.net/my-game/tasks.json?orderBy="$priority"'
The orderBy value must be a JSON string. Wrap it in double quotes in the URL. Most shells require escaping: orderBy=\"score\" or orderBy=%22score%22.

Limit results

# First 5 results
curl 'https://chess-app.larkdb.net/my-game/players.json?orderBy="score"&limitToFirst=5'

# Last 10 results
curl 'https://chess-app.larkdb.net/my-game/players.json?orderBy="score"&limitToLast=10'

Range filters

# Players with score >= 100
curl 'https://chess-app.larkdb.net/my-game/players.json?orderBy="score"&startAt=100'

# Players with score <= 500
curl 'https://chess-app.larkdb.net/my-game/players.json?orderBy="score"&endAt=500'

# Players with score between 100 and 500
curl 'https://chess-app.larkdb.net/my-game/players.json?orderBy="score"&startAt=100&endAt=500'

# Players with exactly 250 points
curl 'https://chess-app.larkdb.net/my-game/players.json?orderBy="score"&equalTo=250'
Range values can be numbers, strings, or booleans. String values must be JSON-encoded (wrapped in quotes).

Formatting

Pretty print

curl 'https://chess-app.larkdb.net/my-game/players.json?print=pretty'
Returns indented, human-readable JSON. Useful for debugging.

Silent response

curl -X PUT 'https://chess-app.larkdb.net/my-game/players/alice/score.json' \
  -d '300' \
  --header 'print: silent'
Or as a query parameter:
curl -X PUT 'https://chess-app.larkdb.net/my-game/players/alice/score.json?print=silent' \
  -d '300'
Returns 204 No Content instead of echoing the written data back. Saves bandwidth on writes when you don’t need the response body.

JSONP

For cross-domain requests from browsers that don’t support CORS:
curl 'https://chess-app.larkdb.net/my-game/players.json?callback=myFunc'
Response:
myFunc({"alice":{"name":"Alice","score":250}})

Download

curl 'https://chess-app.larkdb.net/my-game/players.json?download=players.json'
Sets the Content-Disposition header so browsers treat the response as a file download.

Timeouts

Set a request timeout with the timeout parameter:
# 10-second timeout
curl 'https://chess-app.larkdb.net/my-game/big-dataset.json?timeout=10s'

# 3-minute timeout
curl 'https://chess-app.larkdb.net/my-game/big-dataset.json?timeout=3min'
Valid suffixes: ms, s, min. Maximum timeout is 15 minutes. Default is 30 seconds. If the request exceeds the timeout, you’ll get a 504 Gateway Timeout response.