Market context for
Astro projects.
Use the TickerDB Node.js SDK in Astro API endpoints and <code>.astro</code> components. Pre-computed financial data with no infrastructure to maintain.
Install the SDK.
Add tickerdb to your Astro project. Works with any rendering mode — static, server, or hybrid.
npm install tickerdb Set TICKERDB_KEY in your .env file, then pass import.meta.env.TICKERDB_KEY into the client.
Works in endpoints and components.
Call the SDK in API endpoints for JSON responses, or directly in .astro component frontmatter to render data at build time or on request.
import type { APIRoute } from "astro"; import { TickerDB } from "tickerdb"; const client = new TickerDB({ apiKey: import.meta.env.TICKERDB_KEY }); export const GET: APIRoute = async ({ params }) => { const { data } = await client.summary(params.ticker!); return new Response(JSON.stringify(data), { headers: { "Content-Type": "application/json" }, }); };
--- import { TickerDB } from "tickerdb"; const client = new TickerDB({ apiKey: import.meta.env.TICKERDB_KEY }); const { data } = await client.summary("AAPL"); --- <div> <h2>AAPL</h2> <p>Trend: {data.trend.direction}</p> <p>RSI: {data.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 type { APIRoute } from "astro"; import { TickerDB } from "tickerdb"; const client = new TickerDB({ apiKey: import.meta.env.TICKERDB_KEY }); export const GET: APIRoute = async () => { const { data } = await client.watchlistChanges(); return new Response(JSON.stringify(data), { headers: { "Content-Type": "application/json" }, }); };
{ "timeframe": "daily", "run_date": "2026-03-28", "changes": { "AAPL": [ { "field": "rsi_zone", "from": "neutral", "to": "oversold" }, { "field": "trend_direction", "from": "uptrend", "to": "downtrend" } ] }, "ticker_context": { "AAPL": { "last_changed_date": "2026-03-28" } }, "tickers_checked": 2, "tickers_changed": 1 }
Feed an AI agent.
TickerDB's categorical-first 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 type { APIRoute } from "astro"; import { TickerDB } from "tickerdb"; import Anthropic from "@anthropic-ai/sdk"; const client = new TickerDB({ apiKey: import.meta.env.TICKERDB_KEY }); const anthropic = new Anthropic(); export const GET: APIRoute = async ({ params }) => { const { data } = 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(data)}`, }], }); return new Response(JSON.stringify({ analysis: msg.content[0].text }), { headers: { "Content-Type": "application/json" }, }); };
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", "data_status": "eod", "as_of_date": "2026-04-11", "trend": { "direction": "strong_uptrend", "ma_alignment": "aligned_bullish" }, "momentum": { "rsi_zone": "overbought", "macd_state": "expanding_positive", "direction": "accelerating" }, "volatility": { "regime": "normal", "regime_trend": "stable" }, "fundamentals": { "valuation_zone": "fair_value", "pe_vs_historical_zone": "premium", "last_earnings_surprise": "beat" } }
What you can call.
Every tool returns pre-computed market-state data: categorical facts plus supporting metadata your agent can reason about immediately.
Full market-state snapshot for a single asset: trend, momentum, volatility, volume, extremes, fundamentals, and support/resistance.
Multi-field filtering across all assets. Build complex queries with arbitrary filter combinations.
All queryable fields with types, values, and descriptions. Always free.
Latest EOD summary data for all tickers in your saved watchlist.
Field-level diffs for your watchlist since the last pipeline run.
Register a webhook URL for watchlist change notifications.
List your registered webhook URLs.
Remove a registered webhook.
Built for how agents consume data.
Market-state 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. TickerDB handles computation and syncing.