Live Bitcoin spot ticks aggregated across exchanges: price, bid/ask, 24h change.
{
"type": "object",
"properties": {
"symbol": {
"type": "string"
},
"price": {
"type": "number"
},
"bid": {
"type": "number"
},
"ask": {
"type": "number"
},
"change24h": {
"type": "number"
},
"volume24h": {
"type": "integer"
},
"ts": {
"type": "integer"
}
},
"required": [
"symbol",
"price",
"bid",
"ask",
"change24h",
"volume24h",
"ts"
]
}export interface CryptoMarketPulseBtc {
symbol: Symbol;
price: number;
bid: number;
ask: number;
change24h: number;
volume24h: number;
ts: number;
}
export enum Symbol {
Btc = "BTC",
}
import { OmniClient } from "omnistream-sdk";
const client = new OmniClient({ token: process.env.OMNI_ACCESS_TOKEN! });
// Fully typed: `data` is inferred as CryptoMarketPulseBtc.
const stream = await client.subscribe<CryptoMarketPulseBtc>("stream-id-alpha-774");
stream.on("data", (data) => {
console.log(data);
});
Install omnistream-sdk, set OMNI_ACCESS_TOKEN, paste the snippet, and you are streaming. Type omni dash in your terminal for the live TUI.