Node 18+ or modern browsers
JavaScript SDK.
Official SiftingIO JavaScript and TypeScript SDK. One client for Node and the browser to pull live and historical market data over REST and WebSocket: crypto, forex, stocks, and commodities.
View on npm1 · Install
install · npm
npm install @siftingio/sdk2 · Fetch a price
Set your API key and request the latest price. The same call works for every market, just change the asset class and symbol.
index.ts
import { SiftingClient } from "@siftingio/sdk"; const sifting = new SiftingClient({ apiKey: process.env.SIFTING_API_KEY,}); // Latest Bitcoin priceconst trade = await sifting.last.trade("crypto", "BTCUSD");console.log(trade.p, trade.t);3 · stream live ticks
stream live ticks
const socket = sifting.ws(); socket.on("tick", (t) => console.log(t.s, t.p)); await socket.connect();socket.subscribe("cex", ["BTCUSD", "ETHUSD"]);