NexusTrade guides

Query market data in TypeScript

Submit bounded lake SQL and retrieve the durable schema and result manifest using the TypeScript SDK.

Use a lake-scoped key

Create a registered API key with lake scope. Use the versioned /api/v1/nexustrade surface through the SDK. OAuth tokens for MCP are not SDK API keys.

typescript
import { NexusTradeClient } from "nexustrade";
const client = new NexusTradeClient();

Submit and read the manifest

Bind the ticker instead of interpolating it into SQL. Set maxRows and select the columns you need. The manifest describes durable parts and schema; download only the parts needed for your analysis.

typescript
const query = await client.createLakeQuery(
  {
    query:
      "SELECT ticker, date, closingPrice FROM lake.daily_ohlc WHERE ticker = ?",
    params: ["AAPL"],
    limits: { maxRows: 10_000 },
  },
  { idempotencyKey: "aapl-daily-v1" }
);
const finished = await client.waitForLakeQuery(query.id as string);
const manifest = await client.getLakeQueryManifest(finished.id as string);

Check coverage and availability dates

After completion, inspect the manifest schema and part metadata before downloading results. If the query returns no rows, review the ticker and dataset coverage before changing the query. If access is denied, check that the runtime key has lake scope. Catalog guidance records nullable fields, source coverage and point-in-time limitations. Preserve those caveats when showing derived metrics. Query completion is not proof the source includes today or that an event was public on its occurrence date.

Continue exploring