File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 11# FinancialModelingPrep.NET
22C# API Client For Financial Modeling Prep API written in .NET 5
3+
4+ ## Installation
5+ ``` powershell
6+ PM> Install-Package MatthiWare.FinancialModelingPrep
7+ ```
8+
9+ # Quick Start
10+
11+ Register FinancialModelingPrepApiClient in Dependency Injection provider
12+
13+ ``` csharp
14+ Services .AddFinancialModelingPrepApiClient (new FinancialModelingPrepOptions ()
15+ {
16+ ApiKey = " API-KEY-HERE"
17+ });
18+ ```
19+
20+ Resolve FMP API Client
21+
22+ ``` csharp
23+ var apiClient = ServiceProvider .GetRequiredService <IFinancialModelingPrepApiClient >();
24+
25+ // do something with apiClient like getting the latest Apple Stock Quote
26+ var quoteResult = await api .CompanyValuation .GetQuoteAsync (" AAPL" );
27+ ```
28+
29+ All API Responses are wrapped in an ` ApiResponse<T> ` object.
30+
31+ ``` csharp
32+ var quoteResult = await api .CompanyValuation .GetQuoteAsync (" AAPL" );
33+
34+ // Display Apple Stock Quote
35+ if (! quoteResult .HasError )
36+ {
37+ Console .WriteLine ($" $AAPL is currently trading at: {quoteResult .Data .Price }" );
38+ }
39+ else
40+ {
41+ Console .WriteLine ($" Error Message: {quoteResult .Error }" );
42+ }
43+ ```
44+
You can’t perform that action at this time.
0 commit comments