@bluefin-ai/nfin
v0.1.1
Published
Lightweight TypeScript SDK for nfin: hosted Nasdaq quotes, prices, options, IPOs, calendars, market movers, news, and Nordic data.
Downloads
289
Maintainers
Readme
@bluefin-ai/nfin
Lightweight TypeScript SDK for nfin, a hosted Nasdaq data API for builders.
nfin gives you access to Nasdaq market data without maintaining your own exchange-site integration: symbol search, quotes, historical prices, options, IPO calendars, market movers, event calendars, ownership, funds, news, screeners, sentiment, and Nasdaq Nordic data through product-native namespaces. Use it for dashboards, agents, notebooks, research tools, watchlists, prototyping, and app backends.
This SDK is intentionally portable: no runtime dependencies, standard fetch,
ESM + CommonJS builds, bundled TypeScript declarations, typed errors, and
automatic retries.
Docs: https://docs.nfin.dev/typescript-sdk
npm install @bluefin-ai/nfinQuick Use
import { Client } from "@bluefin-ai/nfin";
const client = new Client();
const apple = client.ticker("AAPL");
const quote = await apple.quote({ asset_class: "stocks" });
const history = await apple.history({ from_date: "2026-01-01", to_date: "2026-05-01" });
const ipos = await client.ipos.calendar();
console.log(quote.data, history.data, ipos.data);Common Calls
await client.symbols.search("apple");
await client.quotes.get("AAPL", { asset_class: "stocks" });
await client.quotes.batch(["AAPL", "MSFT"]);
await client.prices.history("AAPL", { from_date: "2026-01-01", to_date: "2026-05-01" });
await client.options.chain("AAPL");
await client.events.earnings();
await client.ipos.calendar();
await client.market.movers();
await client.news.pressCenter();
await client.screeners.run("stocks");
await client.nordic.search("ericsson");The client is organized around nfin product areas: symbols, quotes,
prices, options, events, ipos, market, ownership, funds, news,
screeners, sentiment, nordic, and management. Use
client.ticker("AAPL") for symbol-scoped quote, history, chart, options,
dividend, EPS, extended-trading, realtime-trade, and short-interest calls.
Runtime Support
The package uses the standard Fetch API. In Node, use Node 18+ or pass a custom fetch implementation:
const client = new Client({ fetch: myFetch });Configuration can come from constructor options or environment variables in Node-like runtimes:
| Option | Environment | Purpose |
| --- | --- | --- |
| baseUrl | NFIN_BASE_URL | Override https://api.nfin.dev; must be http or https |
| contact | NFIN_CONTACT | Send optional support metadata |
| apiKey | NFIN_API_KEY | Send email-verified API credentials |
| managementToken | NFIN_MANAGEMENT_TOKEN | Manage API keys after email verification |
apiKey is sent as Authorization: Bearer <key> by default. Pass
apiKeyHeader: "x-nfin-key" to use X-Nfin-Key instead.
The SDK retries transient 429, 502, 503, and 504 responses by default.
Use maxRetries, retryStatuses, backoffFactorMs, maxBackoffMs, and
backoffJitter when you need tighter control, or set maxRetries: 0.
Keep API keys on a server when you do not control the runtime.
Errors
HTTP errors throw NfinError. HTTP 429 throws NfinRateLimitError; HTTP 503
throws NfinServiceBusyError after retry exhaustion. Error objects include
retryAfterSeconds, status, code, response payloads, and response headers.
