Market data for
SvelteKit apps.

Use the TickerDB Node.js SDK in SvelteKit server load functions and API routes. Pre-computed financial data, no infrastructure.

Install the SDK.

Add tickerdb to your SvelteKit project.

terminal
npm install tickerdb

Set TICKERDB_KEY in your .env file.

Works where SvelteKit runs server-side.

Call the SDK in server load functions and API routes. Data never touches the client bundle.

Server Load Function src/routes/stock/[ticker]/+page.server.ts
import { TickerDB } from "tickerdb";
const client = new TickerDB(process.env.TICKERDB_KEY);

export async function load({ params }) {
  const summary = await client.summary(params.ticker);
  return { summary };
}
API Route src/routes/api/events/[ticker]/+server.ts
import { json } from "@sveltejs/kit";
import { TickerDB } from "tickerdb";

const client = new TickerDB(process.env.TICKERDB_KEY);

export async function GET({ params, url }) {
  const field = url.searchParams.get("field") ?? "rsi_zone";
  const band = url.searchParams.get("band") ?? "deep_oversold";
  const events = await client.getEvents(params.ticker, field, band);
  return json(events);
}

Track state changes effortlessly.

Most market data APIs return point-in-time snapshots. TickerDB tracks state transitions — your agent sees what changed, not just what is.

API Route src/routes/api/watchlist/changes/+server.ts
import { json } from "@sveltejs/kit";
import { TickerDB } from "tickerdb";

const client = new TickerDB(process.env.TICKERDB_KEY);

export async function GET() {
  const changes = await client.watchlist.changes();

  // each change includes from/to transitions
  // e.g. trend: "downtrend" → "uptrend"
  return json(changes);
}
json
{
  "ticker": "AAPL",
  "changes": [
    {
      "field": "rsi_zone",
      "from": "neutral",
      "to": "oversold"
    },
    {
      "field": "trend",
      "from": "uptrend",
      "to": "downtrend"
    }
  ]
}

Feed an AI agent.

TickerDB's categorical output is designed for LLMs. Feed a summary directly into a prompt — the model already understands terms like "oversold" and "strong_uptrend" without extra context.

API Route src/routes/api/briefing/[ticker]/+server.ts
import { json } from "@sveltejs/kit";
import { TickerDB } from "tickerdb";
import Anthropic from "@anthropic-ai/sdk";

const client = new TickerDB(process.env.TICKERDB_KEY);
const anthropic = new Anthropic();

export async function GET({ params }) {
  const summary = await client.summary(params.ticker);

  const msg = await anthropic.messages.create({
    model: "claude-sonnet-4-20250514",
    max_tokens: 1024,
    messages: [{
      role: "user",
      content: `Analyze this stock data:\n${JSON.stringify(summary)}`,
    }],
  });

  return json({ analysis: msg.content[0].text });
}

What your agent sees.

Every tool returns categorical facts — not raw OHLCV data. Your agent can branch on "oversold" without needing to know what RSI > 70 means.

json
{
  "ticker": "NVDA",
  "trend": "strong_uptrend",
  "momentum": {
    "rsi_zone": "overbought",
    "macd_signal": "bullish"
  },
  "volatility": "high",
  "fundamentals": {
    "pe_zone": "above_historical_avg",
    "earnings_surprise": "positive"
  }
}

What you can call.

Every tool returns categorical, pre-computed data. Your agent gets facts it can reason about immediately.

get_summary

Full categorical snapshot for a single asset — trend, momentum, volatility, volume, extremes, fundamentals, support/resistance.

get_watchlist

Live summary data for all tickers in your saved watchlist.

get_watchlist_changes

Field-level diffs for your watchlist since the last pipeline run.

add_to_watchlist

Add tickers to your persistent watchlist.

remove_from_watchlist

Remove tickers from your watchlist.

get_search

Multi-field filtering across all assets. Build complex queries with arbitrary filter combinations.

get_schema

All queryable fields with types, values, and descriptions. Always free.

get_account

Your plan tier, rate limits, and current API usage.

create_webhook

Register a webhook URL for watchlist change notifications.

list_webhooks

List your registered webhook URLs.

delete_webhook

Remove a registered webhook.

Built for how agents consume data.

Categorical data, less prompt engineering

Responses like "rsi_zone": "oversold" are already in a format the model understands. No need to explain what RSI > 70 means.

Compact responses

Tool-call context windows are limited. TickerDB responses are a fraction of the tokens you'd need to pass raw OHLCV data.

Pre-computed daily

No infrastructure to maintain. No cron jobs, no indicator math, no data pipelines. TickerDB handles computation and syncing.

Start building.

Try for free. No credit card required.