Search by name, SuiNS, address, digest, object ID, coin type or checkpoint.

API
query.create

SQL

query.create

Save a query

Details

Endpoint
POST /v1/query
Credits
Free
Rate class
Light. Counts against your light requests per second.
Also called
/api/v1/query

Saves a SQL query with its parameters and visualizations under your account and returns its query_id. Queries are public unless is_private is true. Needs a login or an API key.

Parameters

NameTypeDescription
namestring
descriptionstring
query_sqlstringThe SQL (also accepted as sql).
dialectstringOne of "tide", "trino".
query_parametersarray of any[{ key, type: text | number | date | list, value, options? }]
visualizationsarray of any[{ id, type, name, config }]
tagsarray of any
is_privateboolean

Request

Send your key in the x-api-key header, or leave it out to use the keyless tier.

curl
curl -X POST "https://api.tide.ad/v1/query" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
  "name": "Latest checkpoints",
  "query_sql": "SELECT sequence_number, block_time FROM sui.checkpoints ORDER BY sequence_number DESC LIMIT 10"
}'
TypeScript
const res = await fetch("https://api.tide.ad/v1/query", {
  method: "POST",
  headers: {
    "x-api-key": process.env.TIDE_API_KEY!,
    "content-type": "application/json",
  },
  body: JSON.stringify({
    "name": "Latest checkpoints",
    "query_sql": "SELECT sequence_number, block_time FROM sui.checkpoints ORDER BY sequence_number DESC LIMIT 10"
  }),
});
const data = await res.json();

Response

No example response is available for this method yet.