Market data for
Next.js apps.
Stock market data for Next.js — pre-computed categories, state change tracking, and historical event queries via the TickerDB Node.js SDK. Works in API routes, server components, and server actions.
Install the SDK.
Add tickerdb to your Next.js project. Works with the App Router and Pages Router.
npm install tickerdb Set TICKERDB_KEY in your environment variables. The SDK reads it automatically.
Works where Next.js runs server-side.
Call the SDK in any server context — API routes, server components, server actions. Data never touches the client bundle.
import { TickerDB } from "tickerdb"; const client = new TickerDB(process.env.TICKERDB_KEY!); export async function GET( request: Request, { params }: { params: { ticker: string } } ) { const summary = await client.summary(params.ticker); return Response.json(summary); }
import { TickerDB } from "tickerdb"; const client = new TickerDB(process.env.TICKERDB_KEY!); export default async function StockCard({ ticker }: { ticker: string }) { const summary = await client.summary(ticker); return ( <div> <h2>{ticker}</h2> <p>Trend: {summary.trend.direction}</p> <p>RSI: {summary.momentum.rsi_zone}</p> </div> ); }
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.
import { TickerDB } from "tickerdb"; import { NextResponse } from "next/server"; const client = new TickerDB(process.env.TICKERDB_KEY!); export async function GET() { const changes = await client.watchlist.changes(); return NextResponse.json(changes); } // Response includes from/to transitions: // { "ticker": "AAPL", "field": "rsi_zone", // "from": "neutral", "to": "oversold" }
{ "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.
import { TickerDB } from "tickerdb"; import Anthropic from "@anthropic-ai/sdk"; const ticker = new TickerDB(process.env.TICKERDB_KEY!); const anthropic = new Anthropic(); export async function GET( request: Request, { params }: { params: { ticker: string } } ) { const summary = await ticker.summary(params.ticker); const message = await anthropic.messages.create({ model: "claude-sonnet-4-20250514", max_tokens: 1024, messages: [{ role: "user", content: `Analyze this market data for ${params.ticker} and provide a brief:\n${JSON.stringify(summary)}` }] }); return Response.json({ analysis: message.content }); }
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.
{ "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.
Full categorical snapshot for a single asset — trend, momentum, volatility, volume, extremes, fundamentals, support/resistance.
Live summary data for all tickers in your saved watchlist.
Field-level diffs for your watchlist since the last pipeline run.
Add tickers to your persistent watchlist.
Remove tickers from your watchlist.
Multi-field filtering across all assets. Build complex queries with arbitrary filter combinations.
All queryable fields with types, values, and descriptions. Always free.
Your plan tier, rate limits, and current API usage.
Register a webhook URL for watchlist change notifications.
List your registered webhook URLs.
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.