pviotti / finnhub-dotnet

A .NET client for Finnhub API
MIT License
3 stars 0 forks source link
dotnet finance finnhub stocks

Finnhub API .NET Client

.NET CI NuGet version (Finnhub)

A .NET client for Finnhub API. It's written in F# and only supports .NET 5+ since it uses System.Text.JSON and the JSON HTTP extension from its standard library.

:construction_worker: At the moment only some APIs are supported (mainly the non-Premium ones, see here). There isn't any technical reason preventing the implementation of the other APIs, and I welcome contributions.

:information_source: As an alternative to this library, you can also use a .NET client automatically generated from the Finnhub OpenAPI specification using the Microsoft.dotnet-openapi tool -- see the generated folder.

Install

dotnet add package Finnhub

See nuget.org.

Usage

open Finnhub
let client = Client "your-api-key"
client.Quote "AAPL"
    |> Async.RunSynchronously
    |> printfn "%A"

[TODO: add C# example]

Related projects

There are a few other Finnhub API clients for .NET, such as ThreeFourteen.FinnhubClient and FinnHub.NET. However, the existing clients have some issues (e.g. lack of API coverage, lack of documentation). Also, I'd rather have a simpler API wrapper without any external dependencies, so I decided to write this.