Creating a Predefined Query
Useclient.createQuery() to define a named query with an optional set of parameters.
Parameter Options
Each entry in theparameters array accepts:
| Field | Type | Description |
|---|---|---|
name | string | Parameter name, used as the URL query parameter |
field_path | string | Field path in the query (e.g., "market" or "price.$gte") |
default | any | Default value when the parameter is not provided |
required | boolean | If true, the parameter must be supplied at execution time |
description | string | Human-readable description of the parameter |
Advanced Options
createQuery also supports optional metadata fields for documentation purposes:
Executing a Query
Useclient.executeQuery() to run a predefined query. This calls a public endpoint — no authentication is required.
QueryDataResponse format:
Public API Endpoint
Under the hood,executeQuery calls:
Managing Queries
List All Queries
QueryDefinition includes:
Get a Single Query
Delete a Query
Use Cases
- Public API endpoints — Expose curated data from your collections without sharing app keys.
- Parameterized queries for frontends — Let client-side code fetch data with query parameters, while the server controls the base query shape and accessible fields.
- Rate-limited data access — Provide controlled read access to third parties without granting full API credentials.
- Versioned queries — Use the
versionparameter to maintain backward compatibility when updating query logic.