Market data for
Astro projects.

Use the TickerAPI 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 tickerapi to your Astro project. Works with any rendering mode — static, server, or hybrid.

terminal
npm install tickerapi

Set TICKERAPI_KEY in your .env file. Access it with import.meta.env.TICKERAPI_KEY.

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.

API Endpoint src/pages/api/summary/[ticker].ts
import type { APIRoute } from "astro";
import { TickerAPI } from "tickerapi";

const client = new TickerAPI(import.meta.env.TICKERAPI_KEY);

export const GET: APIRoute = async ({ params }) => {
  const summary = await client.summary(params.ticker!);
  return new Response(JSON.stringify(summary), {
    headers: { "Content-Type": "application/json" },
  });
};
Astro Component src/components/StockCard.astro
---
import { TickerAPI } from "tickerapi";
const client = new TickerAPI(import.meta.env.TICKERAPI_KEY);
const summary = await client.summary("AAPL");
---
<div>
  <h2>AAPL</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. TickerAPI tracks state transitions — your agent sees what changed, not just what is.

API Endpoint src/pages/api/watchlist/changes.ts
import type { APIRoute } from "astro";
import { TickerAPI } from "tickerapi";

const client = new TickerAPI(import.meta.env.TICKERAPI_KEY);

export const GET: APIRoute = async () => {
  const changes = await client.watchlist.changes();
  return new Response(JSON.stringify(changes), {
    headers: { "Content-Type": "application/json" },
  });
};
json
{
  "ticker": "AAPL",
  "changes": [
    {
      "field": "rsi_zone",
      "from": "neutral",
      "to": "oversold"
    },
    {
      "field": "trend",
      "from": "uptrend",
      "to": "downtrend"
    }
  ]
}

Feed an AI agent.

TickerAPI'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 Endpoint src/pages/api/briefing/[ticker].ts
import type { APIRoute } from "astro";
import { TickerAPI } from "tickerapi";
import Anthropic from "@anthropic-ai/sdk";

const client = new TickerAPI(import.meta.env.TICKERAPI_KEY);
const anthropic = new Anthropic();

export const GET: APIRoute = async ({ 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 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.

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 factual snapshot for a single asset — trend, momentum, fundamentals, support/resistance.

compare_assets

Side-by-side technical and fundamental comparison of two or more tickers.

list_assets

Browse all supported tickers with filtering and search.

list_sectors

List all valid sector values with asset counts for scan filtering.

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.

scan_oversold

Assets in confirmed oversold conditions across multiple indicators.

scan_overbought

Assets in overbought RSI conditions with severity rankings.

scan_breakouts

Momentum breakouts with volume confirmation.

scan_unusual_volume

Volume anomalies and accumulation patterns.

scan_valuation

Historically undervalued or overvalued assets based on fundamental metrics.

scan_insider_activity

Notable insider buying and selling activity.

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. TickerAPI 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. TickerAPI handles computation and syncing.

Start building.

Try for free. No credit card required.