Skip to content

Latest commit

 

History

History
33 lines (28 loc) · 1.22 KB

README.md

File metadata and controls

33 lines (28 loc) · 1.22 KB

FinnhubRealtime logo

FinnhubRealtime

NuGet version (FinnhubRealtime) Build Status

FinnhubRealtime is a .Net Standard 2.1 client library for receiving Finnhub.io real-time price updates via the websocket interface. A small demo application can be found in this repository.

Screenshot of demo application

Usage

using var cl = new WebsocketClient("YOUR API TOKEN");
await cl.Connect();
await cl.Subscribe("AAPL");
while (true)
{
    var msg = await cl.Receive();
    if (msg is TradeMessage trade) {
        var tradeStr = string.Join("\n", trade.Data.Select(t => $"{t.S} - #{t.V} x {t.P}"));
        Console.WriteLine(tradeStr);
    }
}