diff --git a/FinancialModelingPrepApi/Abstractions/AdvancedData/IAdvancedDataProvider.cs b/FinancialModelingPrepApi/Abstractions/AdvancedData/IAdvancedDataProvider.cs index abe0bb1..26ab0df 100644 --- a/FinancialModelingPrepApi/Abstractions/AdvancedData/IAdvancedDataProvider.cs +++ b/FinancialModelingPrepApi/Abstractions/AdvancedData/IAdvancedDataProvider.cs @@ -21,9 +21,9 @@ public interface IAdvancedDataProvider Task> GetStockPeersAsync(string symbol); Task>> GetSectorsPriceEarningsRatioAsync(string date, string exchange); Task>> GetIndustriesPriceEarningsRatioAsync(string date, string exchange); - + Task>> GetCommitmentOfTradersReportAsync(string symbol); Task> GetSharesFloatAsync(string symbol); - Task>> GetESGScoreAsync(string symbol); + Task>> GetFinancialScoreAsync(string symbol); } } diff --git a/FinancialModelingPrepApi/Abstractions/Crypto/ICryptoMarketProvider.cs b/FinancialModelingPrepApi/Abstractions/Crypto/ICryptoMarketProvider.cs index 9b7dbda..a7bffb1 100644 --- a/FinancialModelingPrepApi/Abstractions/Crypto/ICryptoMarketProvider.cs +++ b/FinancialModelingPrepApi/Abstractions/Crypto/ICryptoMarketProvider.cs @@ -1,17 +1,21 @@ using MatthiWare.FinancialModelingPrep.Model; using MatthiWare.FinancialModelingPrep.Model.Crypto; -using MatthiWare.FinancialModelingPrep.Model.StockMarket; using System.Collections.Generic; using System.Threading.Tasks; -namespace MatthiWare.FinancialModelingPrep.Abstractions.StockMarket +namespace MatthiWare.FinancialModelingPrep.Abstractions.Crypto { public interface ICryptoMarketProvider { - public Task>> GetAvilableCryptocurrencies(); + Task>> GetAvilableCryptocurrenciesAsync(); + Task>> GetDailyQuotes(); - public Task>> GetHistoricalPrices(string symbol, HistoricalPricingPeriod period); + Task> GetHistoricalQuoteAsync(string symbol); - public Task> GetDailyPrices(string symbol); + Task> GetHistoricalQuoteAsync(string symbol, string from, string to); + + Task>> GetHistoricalQuoteAsync(string symbol, HistoricalPricingPeriod period); + + Task>> GetQuoteAsync(string symbol); } } diff --git a/FinancialModelingPrepApi/Abstractions/Forex/IForexMarketProvider.cs b/FinancialModelingPrepApi/Abstractions/Forex/IForexMarketProvider.cs new file mode 100644 index 0000000..99ca6ac --- /dev/null +++ b/FinancialModelingPrepApi/Abstractions/Forex/IForexMarketProvider.cs @@ -0,0 +1,16 @@ +using MatthiWare.FinancialModelingPrep.Model; +using MatthiWare.FinancialModelingPrep.Model.Forex; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace MatthiWare.FinancialModelingPrep.Abstractions.Forex +{ + public interface IForexMarketProvider + { + Task>> GetBookAsync(string symbol); + + Task>> GetQuoteAsync(string symbol); + + Task>> GetHistoricalQuoteAsync(string symbol, HistoricalPricingPeriod period); + } +} diff --git a/FinancialModelingPrepApi/Abstractions/Futures/IFuturesMarketProvider.cs b/FinancialModelingPrepApi/Abstractions/Futures/IFuturesMarketProvider.cs new file mode 100644 index 0000000..74b7f88 --- /dev/null +++ b/FinancialModelingPrepApi/Abstractions/Futures/IFuturesMarketProvider.cs @@ -0,0 +1,14 @@ +using MatthiWare.FinancialModelingPrep.Model; +using MatthiWare.FinancialModelingPrep.Model.Futures; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace MatthiWare.FinancialModelingPrep.Abstractions.Futures +{ + public interface IFuturesMarketProvider + { + Task>> GetQuoteAsync(string symbol); + + Task>> GetHistoricalQuoteAsync(string symbol, HistoricalPricingPeriod period); + } +} diff --git a/FinancialModelingPrepApi/Abstractions/IFinancialModelingPrepApiClient.cs b/FinancialModelingPrepApi/Abstractions/IFinancialModelingPrepApiClient.cs index 6db3f66..f0111e0 100644 --- a/FinancialModelingPrepApi/Abstractions/IFinancialModelingPrepApiClient.cs +++ b/FinancialModelingPrepApi/Abstractions/IFinancialModelingPrepApiClient.cs @@ -1,7 +1,10 @@ using MatthiWare.FinancialModelingPrep.Abstractions.AdvancedData; using MatthiWare.FinancialModelingPrep.Abstractions.Calendars; using MatthiWare.FinancialModelingPrep.Abstractions.CompanyValuation; +using MatthiWare.FinancialModelingPrep.Abstractions.Crypto; +using MatthiWare.FinancialModelingPrep.Abstractions.Forex; using MatthiWare.FinancialModelingPrep.Abstractions.Fund; +using MatthiWare.FinancialModelingPrep.Abstractions.Futures; using MatthiWare.FinancialModelingPrep.Abstractions.InstitutionalFund; using MatthiWare.FinancialModelingPrep.Abstractions.MarketIndexes; using MatthiWare.FinancialModelingPrep.Abstractions.Statistics; @@ -61,6 +64,16 @@ public interface IFinancialModelingPrepApiClient /// ICryptoMarketProvider Crypto { get; } + /// + /// Forex related enpoints + /// + IForexMarketProvider Forex { get; } + + /// + /// Futures related enpoints + /// + IFuturesMarketProvider Futures { get; } + /// /// ETF/Mutual Fund related enpoints /// diff --git a/FinancialModelingPrepApi/Abstractions/Model/ICurrentQuote.cs b/FinancialModelingPrepApi/Abstractions/Model/ICurrentQuote.cs new file mode 100644 index 0000000..75d1ca5 --- /dev/null +++ b/FinancialModelingPrepApi/Abstractions/Model/ICurrentQuote.cs @@ -0,0 +1,74 @@ +using System; +using System.Text.Json.Serialization; + +namespace MatthiWare.FinancialModelingPrep.Abstractions.Model +{ + public interface ICurrentQuote + { + [JsonPropertyName("symbol")] + public string Symbol { get; set; } + + [JsonPropertyName("name")] + public string Name { get; set; } + + [JsonPropertyName("exchange")] + public string Exchange { get; set; } + + [JsonPropertyName("open")] + public double? Open { get; set; } + + [JsonPropertyName("price")] + public double? Price { get; set; } + + [JsonPropertyName("previousclose")] + public double? PreviousClose { get; set; } + + [JsonPropertyName("daylow")] + public double? DayLow { get; set; } + + [JsonPropertyName("dayhigh")] + public double? DayHigh { get; set; } + + [JsonPropertyName("yearlow")] + public double? YearlyLow { get; set; } + + [JsonPropertyName("yearhigh")] + public double? YearlyHigh { get; set; } + + [JsonPropertyName("priceavg50")] + public double? PriceAvg50 { get; set; } + + [JsonPropertyName("priceavg200")] + public double? PriceAvg200 { get; set; } + + [JsonPropertyName("change")] + public double? Change { get; set; } + + [JsonPropertyName("changespercentage")] + public double? ChangesPercentage { get; set; } + + [JsonPropertyName("timestamp")] + public long? Timestamp { get; set; } + [JsonPropertyName("volume")] + public double? Volume { get; set; } + [JsonPropertyName("avgVolume")] + public double? AvgVolume { get; set; } + + // Not used by Forex or Futures. + + [JsonPropertyName("eps")] + public double? Eps { get; set; } + + [JsonPropertyName("pe")] + public double? Pe { get; set; } + + [JsonPropertyName("earningsAnnouncement")] + public string? EarningsAnnouncement { get; set; } + + [JsonPropertyName("sharesOutstanding")] + public double? SharesOutstanding { get; set; } + + [JsonPropertyName("marketCap")] + public double? MarketCap { get; set; } + } +} diff --git a/FinancialModelingPrepApi/Abstractions/Model/IHistoricalQuote.cs b/FinancialModelingPrepApi/Abstractions/Model/IHistoricalQuote.cs new file mode 100644 index 0000000..b1a15ab --- /dev/null +++ b/FinancialModelingPrepApi/Abstractions/Model/IHistoricalQuote.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json.Serialization; +using System.Threading.Tasks; + +namespace MatthiWare.FinancialModelingPrep.Abstractions.Model +{ + public interface IHistoricalQuote + { + [JsonPropertyName("date")] + public string Date { get; set; } + + [JsonPropertyName("open")] + public double? Open { get; set; } + + [JsonPropertyName("high")] + public double? High { get; set; } + + [JsonPropertyName("low")] + public double? Low { get; set; } + + [JsonPropertyName("close")] + public double Close { get; set; } + + [JsonPropertyName("change")] + public double? Change { get; set; } + [JsonPropertyName("volume")] + public double Volume { get; set; } + + [JsonPropertyName("changePercent")] + public double? ChangePercent { get; set; } + } +} diff --git a/FinancialModelingPrepApi/Abstractions/StockMarket/IStockMarketProvider.cs b/FinancialModelingPrepApi/Abstractions/StockMarket/IStockMarketProvider.cs index 9a8a620..9f52a3a 100644 --- a/FinancialModelingPrepApi/Abstractions/StockMarket/IStockMarketProvider.cs +++ b/FinancialModelingPrepApi/Abstractions/StockMarket/IStockMarketProvider.cs @@ -7,9 +7,12 @@ namespace MatthiWare.FinancialModelingPrep.Abstractions.StockMarket { public interface IStockMarketProvider { + public Task>> GetNasdaqConstituents(); + public Task>> GetSP500Constituents(); public Task>> GetMostActiveStocksAsync(); public Task>> GetBiggestGainerStocksAsync(); public Task>> GetBiggestLoserStocksAsync(); + public Task> GetStockHistoricalDividends(string symbol); public Task>> StockScreener(int? marketCapMoreThan = null, int? marketCapLowerThan = null, decimal? priceMoreThan = null, decimal? priceLowerThan = null, decimal? betaMoreThan = null, decimal? betaLowerThan = null, int? volumeMoreThan = null, int? volumeLowerThan = null, bool? isEtf = null, bool? isActivelyTraded = null, Sector? sector = null, Industry? industry = null, Country? country = null, Exchange? exchange = null, int? limit = 30); diff --git a/FinancialModelingPrepApi/Abstractions/StockTimeSeries/HistoricalChartSeries.cs b/FinancialModelingPrepApi/Abstractions/StockTimeSeries/HistoricalChartSeries.cs deleted file mode 100644 index a3b38f9..0000000 --- a/FinancialModelingPrepApi/Abstractions/StockTimeSeries/HistoricalChartSeries.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace MatthiWare.FinancialModelingPrep.Abstractions.StockTimeSeries -{ - public enum HistoricalChartSeries - { - OneMinute, - FiveMinutes, - FifteenMinutes, - ThirtyMinutes, - Hourly, - FourHours - } -} diff --git a/FinancialModelingPrepApi/Abstractions/StockTimeSeries/IStockTimeSeriesProvider.cs b/FinancialModelingPrepApi/Abstractions/StockTimeSeries/IStockTimeSeriesProvider.cs index 09cdffc..5c27a12 100644 --- a/FinancialModelingPrepApi/Abstractions/StockTimeSeries/IStockTimeSeriesProvider.cs +++ b/FinancialModelingPrepApi/Abstractions/StockTimeSeries/IStockTimeSeriesProvider.cs @@ -1,4 +1,5 @@ using MatthiWare.FinancialModelingPrep.Model; +using MatthiWare.FinancialModelingPrep.Model.StockMarket; using MatthiWare.FinancialModelingPrep.Model.StockTimeSeries; using System.Collections.Generic; using System.Threading.Tasks; @@ -7,6 +8,12 @@ namespace MatthiWare.FinancialModelingPrep.Abstractions.StockTimeSeries { public interface IStockTimeSeriesProvider { + /// + /// Get the latest quote for given stock. + /// + /// + /// + public Task>> GetQuoteAsync(string symbol); /// /// Get Daily Historical Dividends /// @@ -61,6 +68,6 @@ public interface IStockTimeSeriesProvider /// Ticker symbol /// Time series /// - Task>> GetHistoricalPricesForChartWithVolume(string symbol, HistoricalChartSeries series); + Task>> GetHistoricalPricesForChartWithVolume(string symbol, HistoricalPricingPeriod series); } } diff --git a/FinancialModelingPrepApi/Core/AdvancedData/AdvancedDataProvider.cs b/FinancialModelingPrepApi/Core/AdvancedData/AdvancedDataProvider.cs index 6ed3729..77b606e 100644 --- a/FinancialModelingPrepApi/Core/AdvancedData/AdvancedDataProvider.cs +++ b/FinancialModelingPrepApi/Core/AdvancedData/AdvancedDataProvider.cs @@ -77,7 +77,51 @@ private async Task> GetSta return ApiResponse.FromError(result.Error); } - return ApiResponse.FromSucces(result.Data.First()); + return ApiResponse.FromSuccess(result.Data.First()); + } + + public async Task>> GetCommitmentOfTradersReportAsync(string symbol) + { + const string url = "[version]/commitment_of_traders_report"; + + var pathParams = new NameValueCollection() + { + { "version", ApiVersion.v4.ToString() } + }; + + var queryString = new QueryStringBuilder(); + queryString.Add("symbol", symbol); + + var result = await client.GetJsonAsync>(url, pathParams, queryString); + + if (result.HasError) + { + return ApiResponse.FromError>(result.Error); + } + + return ApiResponse.FromSuccess(result.Data); + } + + public async Task>> GetFinancialScoreAsync(string symbol) + { + const string url = "[version]/score"; + + var pathParams = new NameValueCollection() + { + { "version", ApiVersion.v4.ToString() } + }; + + var queryString = new QueryStringBuilder(); + queryString.Add("symbol", symbol); + + var result = await client.GetJsonAsync>(url, pathParams, queryString); + + if (result.HasError) + { + return ApiResponse.FromError>(result.Error); + } + + return ApiResponse.FromSuccess(result.Data); } public async Task> GetStockPeersAsync(string symbol) @@ -99,7 +143,7 @@ public async Task> GetStockPeersAsync(string s return ApiResponse.FromError(result.Error); } - return ApiResponse.FromSucces(result.Data.First()); + return ApiResponse.FromSuccess(result.Data.First()); } public Task>> GetSectorsPriceEarningsRatioAsync(string date, string exchange) @@ -156,7 +200,7 @@ public async Task> GetSharesFloatAsync(string s return ApiResponse.FromError(result.Error); } - return ApiResponse.FromSucces(result.Data.First()); + return ApiResponse.FromSuccess(result.Data.First()); } public Task>> GetESGScoreAsync(string symbol) diff --git a/FinancialModelingPrepApi/Core/CompanyValuation/CompanyValuationProvider.cs b/FinancialModelingPrepApi/Core/CompanyValuation/CompanyValuationProvider.cs index 44d67df..f7701cb 100644 --- a/FinancialModelingPrepApi/Core/CompanyValuation/CompanyValuationProvider.cs +++ b/FinancialModelingPrepApi/Core/CompanyValuation/CompanyValuationProvider.cs @@ -36,7 +36,7 @@ public async Task> GetCompanyProfileAsync(st return ApiResponse.FromError(result.Error); } - return ApiResponse.FromSucces(result.Data.First()); + return ApiResponse.FromSuccess(result.Data.First()); } public Task>> GetETFListAsync() @@ -264,7 +264,7 @@ public async Task> GetCompanyRatingAsync(stri return ApiResponse.FromError(result.Error); } - return ApiResponse.FromSucces(result.Data.First()); + return ApiResponse.FromSuccess(result.Data.First()); } public Task>> GetHistoricalCompanyRatingAsync(string symbol, int? limit = 140) @@ -304,7 +304,7 @@ public async Task> GetDiscountedCashFlowAsync(string sy return ApiResponse.FromError(result.Error); } - return ApiResponse.FromSucces(result.Data.First()); + return ApiResponse.FromSuccess(result.Data.First()); } public Task>> GetHistoricalDiscountedCashFlowAsync(string symbol, Period period = Period.Annual) @@ -364,7 +364,7 @@ public async Task> GetRatiosTTMAsync(string symbo return ApiResponse.FromError(result.Error); } - return ApiResponse.FromSucces(result.Data.First()); + return ApiResponse.FromSuccess(result.Data.First()); } public async Task> GetCompanyKeyMetricsTTMAsync(string symbol) @@ -384,7 +384,7 @@ public async Task> GetCompanyKeyMetricsTTMAsy return ApiResponse.FromError(result.Error); } - return ApiResponse.FromSucces(result.Data.First()); + return ApiResponse.FromSuccess(result.Data.First()); } public Task>> GetCompanyKeyMetricsAsync(string symbol, Period period = Period.Annual, int? limit = 130) @@ -429,7 +429,7 @@ public async Task> GetQuoteAsync(string symbol) return ApiResponse.FromError(result.Error); } - return ApiResponse.FromSucces(result.Data.First()); + return ApiResponse.FromSuccess(result.Data.First()); } public Task>> GetQuotesAsync(IEnumerable symbols) @@ -482,7 +482,7 @@ public async Task> GetMarketCapitalizationAsync(s return ApiResponse.FromError(result.Error); } - return ApiResponse.FromSucces(result.Data.First()); + return ApiResponse.FromSuccess(result.Data.First()); } public Task>> GetHistoricalMarketCapitalizationAsync(string symbol, int? limit = 100) diff --git a/FinancialModelingPrepApi/Core/Crypto/CryptoMarketProvider.cs b/FinancialModelingPrepApi/Core/Crypto/CryptoMarketProvider.cs index 0990a98..829a7b4 100644 --- a/FinancialModelingPrepApi/Core/Crypto/CryptoMarketProvider.cs +++ b/FinancialModelingPrepApi/Core/Crypto/CryptoMarketProvider.cs @@ -1,8 +1,8 @@ -using MatthiWare.FinancialModelingPrep.Abstractions.StockMarket; +using MatthiWare.FinancialModelingPrep.Abstractions.Crypto; +using MatthiWare.FinancialModelingPrep.Abstractions.StockMarket; using MatthiWare.FinancialModelingPrep.Core.Http; using MatthiWare.FinancialModelingPrep.Model; using MatthiWare.FinancialModelingPrep.Model.Crypto; -using MatthiWare.FinancialModelingPrep.Model.StockMarket; using System.Collections.Generic; using System.Collections.Specialized; using System.Threading.Tasks; @@ -18,9 +18,8 @@ public CryptoMarketProvider(FinancialModelingPrepHttpClient client) this.client = client ?? throw new System.ArgumentNullException(nameof(client)); } - public Task>> GetAvilableCryptocurrencies() + public async Task>> GetAvilableCryptocurrenciesAsync() { - const string url = "[version]/symbol/available-cryptocurrencies"; var pathParams = new NameValueCollection() @@ -28,10 +27,35 @@ public Task>> GetAvilableCryptocurrencies() { "version", ApiVersion.v3.ToString() } }; - return client.GetJsonAsync>(url, pathParams, null); + return await client.GetJsonAsync>(url, pathParams, null); + } + + public async Task>> GetDailyQuotes() + { + const string url = "[version]/quotes/crypto"; + + var pathParams = new NameValueCollection() + { + { "version", ApiVersion.v3.ToString() } + }; + + return await client.GetJsonAsync>(url, pathParams, null); } - public Task> GetDailyPrices(string symbol) + public async Task>> GetQuoteAsync(string symbol) + { + const string url = "[version]/quote/[symbol]"; + + var pathParams = new NameValueCollection() + { + { "version", ApiVersion.v3.ToString() }, + { "symbol", symbol }, + }; + + return await client.GetJsonAsync>(url, pathParams, null); + } + + public async Task> GetHistoricalQuoteAsync(string symbol) { const string url = "[version]/historical-price-full/[symbol]"; @@ -41,10 +65,29 @@ public Task> GetDailyPrices(string s { "symbol", symbol } }; - return client.GetJsonAsync(url, pathParams, null); + return await client.GetJsonAsync(url, pathParams, null); } - public Task>> GetHistoricalPrices(string symbol, HistoricalPricingPeriod period) + + public async Task> GetHistoricalQuoteAsync(string symbol, string from, string to) + { + const string url = "[version]/historical-price-full/[symbol]"; + + var pathParams = new NameValueCollection() + { + { "version", ApiVersion.v3.ToString() }, + { "symbol", symbol } + }; + + QueryStringBuilder queryString = new QueryStringBuilder(); + + queryString.Add("from", from); + queryString.Add("to", to); + + return await client.GetJsonAsync(url, pathParams, queryString); + } + + public async Task>> GetHistoricalQuoteAsync(string symbol, HistoricalPricingPeriod period) { const string url = "[version]/historical-chart/[pricePeriod]/[symbol]"; @@ -57,9 +100,7 @@ public Task>> GetHistorical { "pricePeriod", pricePeriod } }; - var queryString = new QueryStringBuilder(); - - return client.GetJsonAsync>(url, pathParams, queryString); + return await client.GetJsonAsync>(url, pathParams, null); } } } diff --git a/FinancialModelingPrepApi/Core/FinancialModelingPrepApiClient.cs b/FinancialModelingPrepApi/Core/FinancialModelingPrepApiClient.cs index aa9ce52..0566ae7 100644 --- a/FinancialModelingPrepApi/Core/FinancialModelingPrepApiClient.cs +++ b/FinancialModelingPrepApi/Core/FinancialModelingPrepApiClient.cs @@ -1,7 +1,10 @@ using MatthiWare.FinancialModelingPrep.Abstractions.AdvancedData; using MatthiWare.FinancialModelingPrep.Abstractions.Calendars; using MatthiWare.FinancialModelingPrep.Abstractions.CompanyValuation; +using MatthiWare.FinancialModelingPrep.Abstractions.Crypto; +using MatthiWare.FinancialModelingPrep.Abstractions.Forex; using MatthiWare.FinancialModelingPrep.Abstractions.Fund; +using MatthiWare.FinancialModelingPrep.Abstractions.Futures; using MatthiWare.FinancialModelingPrep.Abstractions.InstitutionalFund; using MatthiWare.FinancialModelingPrep.Abstractions.MarketIndexes; using MatthiWare.FinancialModelingPrep.Abstractions.Statistics; @@ -40,6 +43,12 @@ public class FinancialModelingPrepApiClient : IFinancialModelingPrepApiClient /// public ICryptoMarketProvider Crypto { get; } + /// + public IForexMarketProvider Forex { get; } + + /// + public IFuturesMarketProvider Futures { get; } + /// public IFundProvider Fund { get; } @@ -53,6 +62,8 @@ public FinancialModelingPrepApiClient(ICompanyValuationProvider companyValuation IStockMarketProvider stockMarket, IStockStatisticsProvider stockStatistics, ICryptoMarketProvider cryptoMarket, + IForexMarketProvider forexMarket, + IFuturesMarketProvider futuresMarket, IFundProvider fund) { CompanyValuation = companyValuation; @@ -64,6 +75,8 @@ public FinancialModelingPrepApiClient(ICompanyValuationProvider companyValuation StockMarket = stockMarket; StockStatistics = stockStatistics; Crypto = cryptoMarket; + Forex = forexMarket; + Futures = futuresMarket; Fund = fund; } } diff --git a/FinancialModelingPrepApi/Core/Forex/ForexMarketProvider.cs b/FinancialModelingPrepApi/Core/Forex/ForexMarketProvider.cs new file mode 100644 index 0000000..d82bddc --- /dev/null +++ b/FinancialModelingPrepApi/Core/Forex/ForexMarketProvider.cs @@ -0,0 +1,64 @@ +using MatthiWare.FinancialModelingPrep.Abstractions.Forex; +using MatthiWare.FinancialModelingPrep.Core.Http; +using MatthiWare.FinancialModelingPrep.Model; +using MatthiWare.FinancialModelingPrep.Model.Forex; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Threading.Tasks; + +namespace MatthiWare.FinancialModelingPrep.Core.Forex +{ + public class ForexMarketProvider : IForexMarketProvider + { + private readonly FinancialModelingPrepHttpClient client; + + public ForexMarketProvider(FinancialModelingPrepHttpClient client) + { + this.client = client ?? throw new System.ArgumentNullException(nameof(client)); + } + + + public async Task>> GetBookAsync(string symbol) + { + const string url = "[version]/fx/[symbol]"; + + var pathParams = new NameValueCollection() + { + { "version", ApiVersion.v3.ToString() }, + { "symbol", symbol }, + }; + + return await client.GetJsonAsync>(url, pathParams, null); + } + + + public async Task>> GetQuoteAsync(string symbol) + { + const string url = "[version]/quote/[symbol]"; + + var pathParams = new NameValueCollection() + { + { "version", ApiVersion.v3.ToString() }, + { "symbol", symbol }, + }; + + return await client.GetJsonAsync>(url, pathParams, null); + } + + public async Task>> GetHistoricalQuoteAsync(string symbol, HistoricalPricingPeriod period) + { + const string url = "[version]/historical-chart/[pricePeriod]/[symbol]"; + + string pricePeriod = EnumMappings.HistoricalPrices[period]; + + var pathParams = new NameValueCollection() + { + { "version", ApiVersion.v3.ToString() }, + { "symbol", symbol }, + { "pricePeriod", pricePeriod } + }; + + return await client.GetJsonAsync>(url, pathParams, null); + } + } +} diff --git a/FinancialModelingPrepApi/Core/Futures/FuturesMarketProvider.cs b/FinancialModelingPrepApi/Core/Futures/FuturesMarketProvider.cs new file mode 100644 index 0000000..a365544 --- /dev/null +++ b/FinancialModelingPrepApi/Core/Futures/FuturesMarketProvider.cs @@ -0,0 +1,49 @@ +using MatthiWare.FinancialModelingPrep.Abstractions.Futures; +using MatthiWare.FinancialModelingPrep.Core.Http; +using MatthiWare.FinancialModelingPrep.Model; +using MatthiWare.FinancialModelingPrep.Model.Futures; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Threading.Tasks; + +namespace MatthiWare.FinancialModelingPrep.Core.Futures +{ + public class FuturesMarketProvider : IFuturesMarketProvider + { + private readonly FinancialModelingPrepHttpClient client; + + public FuturesMarketProvider(FinancialModelingPrepHttpClient client) + { + this.client = client ?? throw new System.ArgumentNullException(nameof(client)); + } + + public async Task>> GetQuoteAsync(string symbol) + { + const string url = "[version]/quote/[symbol]"; + + var pathParams = new NameValueCollection() + { + { "version", ApiVersion.v3.ToString() }, + { "symbol", symbol }, + }; + + return await client.GetJsonAsync>(url, pathParams, null); + } + + public async Task>> GetHistoricalQuoteAsync(string symbol, HistoricalPricingPeriod period) + { + const string url = "[version]/historical-chart/[pricePeriod]/[symbol]"; + + string pricePeriod = EnumMappings.HistoricalPrices[period]; + + var pathParams = new NameValueCollection() + { + { "version", ApiVersion.v3.ToString() }, + { "symbol", symbol }, + { "pricePeriod", pricePeriod } + }; + + return await client.GetJsonAsync>(url, pathParams, null); + } + } +} diff --git a/FinancialModelingPrepApi/Core/Http/FinancialModelingPrepHttpClient.cs b/FinancialModelingPrepApi/Core/Http/FinancialModelingPrepHttpClient.cs index 687663c..2d1c18f 100644 --- a/FinancialModelingPrepApi/Core/Http/FinancialModelingPrepHttpClient.cs +++ b/FinancialModelingPrepApi/Core/Http/FinancialModelingPrepHttpClient.cs @@ -66,7 +66,7 @@ public async Task> GetStringAsync(string urlPattern, NameVal return ApiResponse.FromError("Invalid parameters"); } - return ApiResponse.FromSucces(response.Data); + return ApiResponse.FromSuccess(response.Data); } finally { @@ -88,7 +88,7 @@ public async Task> GetJsonAsync(string urlPattern, NameValueCo var data = JsonSerializer.Deserialize(response.Data, jsonSerializerOptions); - return ApiResponse.FromSucces(data); + return ApiResponse.FromSuccess(data); } catch (JsonException ex) { @@ -104,7 +104,7 @@ private async Task> CallApiAsync(string urlPattern, NameValu var requestUrl = $"{urlPattern}{queryString}"; - using var response = await client.GetAsync(requestUrl); + using var response = await client.GetAsync(requestUrl).ConfigureAwait(false); var content = await response.Content.ReadAsStringAsync(); if (!response.IsSuccessStatusCode) @@ -112,7 +112,7 @@ private async Task> CallApiAsync(string urlPattern, NameValu return ApiResponse.FromError($"{response.StatusCode} - {content}"); } - return ApiResponse.FromSucces(content); + return ApiResponse.FromSuccess(content); } private static void PreProcessUrl(ref string url, ref NameValueCollection pathParams, ref QueryStringBuilder qsb) diff --git a/FinancialModelingPrepApi/Core/InstitutionalFund/InstitutionalFundProvider.cs b/FinancialModelingPrepApi/Core/InstitutionalFund/InstitutionalFundProvider.cs index 9662595..5bfe390 100644 --- a/FinancialModelingPrepApi/Core/InstitutionalFund/InstitutionalFundProvider.cs +++ b/FinancialModelingPrepApi/Core/InstitutionalFund/InstitutionalFundProvider.cs @@ -81,7 +81,7 @@ public async Task> MapCusipAsync(string cusip) return ApiResponse.FromError(result.Error); } - return ApiResponse.FromSucces(result.Data.First()); + return ApiResponse.FromSuccess(result.Data.First()); } /// diff --git a/FinancialModelingPrepApi/Core/StockMarket/StockMarketProvider.cs b/FinancialModelingPrepApi/Core/StockMarket/StockMarketProvider.cs index b8435dd..376a16c 100644 --- a/FinancialModelingPrepApi/Core/StockMarket/StockMarketProvider.cs +++ b/FinancialModelingPrepApi/Core/StockMarket/StockMarketProvider.cs @@ -4,6 +4,7 @@ using MatthiWare.FinancialModelingPrep.Model.StockMarket; using System.Collections.Generic; using System.Collections.Specialized; +using System.Net; using System.Threading.Tasks; namespace MatthiWare.FinancialModelingPrep.Core.StockMarket @@ -101,6 +102,43 @@ public Task>> StockScreener(int? marketCapMo return client.GetJsonAsync>(url, pathParams, queryString); } + public Task>> GetSP500Constituents() + { + const string url = "[version]/sp500_constituent"; + + var pathParams = new NameValueCollection() + { + { "version", ApiVersion.v3.ToString() } + }; + + return client.GetJsonAsync>(url, pathParams, null); + } + + public Task>> GetNasdaqConstituents() + { + const string url = "[version]/nasdaq_constituent"; + + var pathParams = new NameValueCollection() + { + { "version", ApiVersion.v3.ToString() } + }; + + return client.GetJsonAsync>(url, pathParams, null); + } + + public Task> GetStockHistoricalDividends(string symbol) + { + const string url = "[version]/[symbol]"; + + var pathParams = new NameValueCollection() + { + { "version", ApiVersion.v3.ToString() }, + { "symbol", symbol }, + }; + + return client.GetJsonAsync(url, pathParams, null); + } + public Task>> GetBiggestGainerStocksAsync() => GetStockMarketData(GainersEndpoint); diff --git a/FinancialModelingPrepApi/Core/StockTimeSeries/StockTimeSeriesProvider.cs b/FinancialModelingPrepApi/Core/StockTimeSeries/StockTimeSeriesProvider.cs index ebbda8d..ff199b4 100644 --- a/FinancialModelingPrepApi/Core/StockTimeSeries/StockTimeSeriesProvider.cs +++ b/FinancialModelingPrepApi/Core/StockTimeSeries/StockTimeSeriesProvider.cs @@ -1,10 +1,12 @@ using MatthiWare.FinancialModelingPrep.Abstractions.StockTimeSeries; using MatthiWare.FinancialModelingPrep.Core.Http; using MatthiWare.FinancialModelingPrep.Model; +using MatthiWare.FinancialModelingPrep.Model.StockMarket; using MatthiWare.FinancialModelingPrep.Model.StockTimeSeries; using System; using System.Collections.Generic; using System.Collections.Specialized; +using System.Linq; using System.Threading.Tasks; namespace MatthiWare.FinancialModelingPrep.Core.StockTimeSeries @@ -18,6 +20,19 @@ public StockTimeSeriesProvider(FinancialModelingPrepHttpClient client) this.client = client ?? throw new ArgumentNullException(nameof(client)); } + public async Task>> GetQuoteAsync(string symbol) + { + const string url = "[version]/quote/[symbol]"; + + var pathParams = new NameValueCollection() + { + { "version", ApiVersion.v3.ToString() }, + { "symbol", symbol }, + }; + + return await client.GetJsonAsync>(url, pathParams, null); + } + /// public Task> GetHistoricalDailyPricesAsync(string symbol) { @@ -33,7 +48,7 @@ public Task> GetHistoricalDailyPricesAsync( } /// - public Task> GetHistoricalDailyPricesAsync(string symbol, string from, string to) + public async Task> GetHistoricalDailyPricesAsync(string symbol, string from, string to) { const string url = "[version]/historical-price-full/[symbol]"; @@ -47,7 +62,7 @@ public Task> GetHistoricalDailyPricesAsync( queryString.Add("from", from); queryString.Add("to", to); - return client.GetJsonAsync(url, pathParams, queryString); + return await client.GetJsonAsync(url, pathParams, queryString); } /// @@ -103,14 +118,16 @@ public Task> GetHistoricalDividendsAsyn } /// - public Task>> GetHistoricalPricesForChartWithVolume(string symbol, HistoricalChartSeries series) + public Task>> GetHistoricalPricesForChartWithVolume(string symbol, HistoricalPricingPeriod series) { const string url = "[version]/historical-chart/[series]/[symbol]"; + string seriesPeriod = EnumMappings.HistoricalPrices[series]; + var pathParams = new NameValueCollection() { { "version", ApiVersion.v3.ToString() }, - { "series", HistoricalChartSeriesToString(series) }, + { "series", seriesPeriod }, { "symbol", symbol } }; @@ -130,19 +147,5 @@ public Task> GetHistoricalStockSplitsA return client.GetJsonAsync(url, pathParams, null); } - - private static string HistoricalChartSeriesToString(HistoricalChartSeries series) - { - return series switch - { - HistoricalChartSeries.OneMinute => "1min", - HistoricalChartSeries.FiveMinutes => "5min", - HistoricalChartSeries.FifteenMinutes => "15min", - HistoricalChartSeries.ThirtyMinutes => "30min", - HistoricalChartSeries.Hourly => "1hour", - HistoricalChartSeries.FourHours => "4hour", - _ => throw new NotImplementedException(), - }; - } } } diff --git a/FinancialModelingPrepApi/DependencyInjectionExtensions.cs b/FinancialModelingPrepApi/DependencyInjectionExtensions.cs index 4311c27..58ab0e2 100644 --- a/FinancialModelingPrepApi/DependencyInjectionExtensions.cs +++ b/FinancialModelingPrepApi/DependencyInjectionExtensions.cs @@ -1,7 +1,10 @@ using MatthiWare.FinancialModelingPrep.Abstractions.AdvancedData; using MatthiWare.FinancialModelingPrep.Abstractions.Calendars; using MatthiWare.FinancialModelingPrep.Abstractions.CompanyValuation; +using MatthiWare.FinancialModelingPrep.Abstractions.Crypto; +using MatthiWare.FinancialModelingPrep.Abstractions.Forex; using MatthiWare.FinancialModelingPrep.Abstractions.Fund; +using MatthiWare.FinancialModelingPrep.Abstractions.Futures; using MatthiWare.FinancialModelingPrep.Abstractions.Http; using MatthiWare.FinancialModelingPrep.Abstractions.InstitutionalFund; using MatthiWare.FinancialModelingPrep.Abstractions.MarketIndexes; @@ -12,7 +15,9 @@ using MatthiWare.FinancialModelingPrep.Core.AdvancedData; using MatthiWare.FinancialModelingPrep.Core.Calendars; using MatthiWare.FinancialModelingPrep.Core.CompanyValuation; +using MatthiWare.FinancialModelingPrep.Core.Forex; using MatthiWare.FinancialModelingPrep.Core.Fund; +using MatthiWare.FinancialModelingPrep.Core.Futures; using MatthiWare.FinancialModelingPrep.Core.Http; using MatthiWare.FinancialModelingPrep.Core.InstitutionalFund; using MatthiWare.FinancialModelingPrep.Core.MarketIndexes; @@ -52,6 +57,8 @@ public static void AddFinancialModelingPrepApiClient(this IServiceCollection ser services.TryAddTransient(); services.TryAddTransient(); services.TryAddTransient(); + services.TryAddTransient(); + services.TryAddTransient(); services.TryAddTransient(); services.TryAddTransient(); } diff --git a/FinancialModelingPrepApi/FinancialModelingPrep.NET/FinancialModelingPrepApi/FinancialModelingPrepApi.xml b/FinancialModelingPrepApi/FinancialModelingPrep.NET/FinancialModelingPrepApi/FinancialModelingPrepApi.xml new file mode 100644 index 0000000..d8142b8 --- /dev/null +++ b/FinancialModelingPrepApi/FinancialModelingPrep.NET/FinancialModelingPrepApi/FinancialModelingPrepApi.xml @@ -0,0 +1,423 @@ + + + + FinancialModelingPrepExtended + + + + + Gets the Earnings Calendar + + Format YYYY-MM-DD + Format YYYY-MM-DD + + + + + Gets the Earnings Calendar + + + + + + Gets the Historical Earnings + + Symbol to use + Limits the amount of items. Null acts as unlimited. + + + + + Gets the IPO Calendar + The maximum time interval between from and to is 3 months. + + From date YYYY-MM-DD + To date YYYY-MM-DD + + + + + Gets the Dividend Calendar + The maximum time interval between from and to is 3 months. + + From date YYYY-MM-DD + To date YYYY-MM-DD + + + + + Gets the Economic Calendar + The maximum time interval between from and to is 3 months. + + From date YYYY-MM-DD + To date YYYY-MM-DD + + + + + Gets the Stock Split Calendar + The maximum time interval between from and to is 3 months. + + From date YYYY-MM-DD + To date YYYY-MM-DD + + + + + Public comapnies sometimes change their symbol and thanks to this endpoint you will be able to know if there is any symbol change happened. + Data for new symbol is getting transferred from the old symbol the same day + + + + + + Complete list of all institutional investment managers by cik + + + + + + Cusip mapper + + + + + + + FORM 13F cik search by name + + + + + + + FORM 13F get company name by cik + + + + + + + FORM 13F statements provides position-level report of all institutional investment managers with more than $100m in assets under management (i.e. Berkshire hathaway cik). + + + + + + + + Stock related statistics + + + + + Get analyst estimates + + Stock symbol + Period (Annual or Quarterly) + Limts the amount of results + + + + + Get the latest quote for given stock. + + + + + + + Get Daily Historical Dividends + + Ticker symbol + + + + + Get Daily Historical Stock Splits + + Ticker symbol + + + + + Get Daily Historical Prices + + Ticker symbol + + + + + Get Daily Historical Prices + + Ticker symbol + From date (YYYY-MM-DD) + To date (YYYY-MM-DD) + + + + + Get Daily Historical Prices + Should be used to display on a linechart + + Ticker symbol + + + + + Get Daily Historical Prices + Should be used to display on a linechart + + Ticker symbol + From date (YYYY-MM-DD) + To date (YYYY-MM-DD) + + + + + Get Daily Historical Prices for charts with volume + + Ticker symbol + Time series + + + + + FMP Client that exposes different sections of Endpoints + + + + + Advanced Data Endpoints are grouped here + Note: most of these endpoints require a premium API Key + + + + + All Company Valuation Endpoints are grouped here + + + + + All Market Index Endpoints are grouped here + + + + + All Calendar related Endpoints are grouped here (Earnings, IPO, stock splits, Dividends, Economic) + + + + + All Instituational Fund Endpoints are grouped here + + + + + All Stock Time Series Endpoints are grouped here + + + + + All Stock Market Related Endpoints are grouped here (Most Active, Gainers, Losers) + + + + + Statistic Related Endpoint are grouped here (Estimates) + + + + + Cryptomarket related enpoints + + + + + Forex related enpoints + + + + + Futures related enpoints + + + + + ETF/Mutual Fund related enpoints + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Adds the to the services. + This package does not override any existing registrations. + + DI Service Collection + FMP Options if left as null it will use the default options and default API Key + + + + Exposes factory methods to easily create clients without using dependency injection. + If you do want to use DI please see + + + + + Creates an FMP API Client with all dependencies already wired up. + If you do want to use DI please see + + + An instance of + + + + FMP Options + + + + + Get or set the FMP API Key. + You can find your API Key in the dashboard (https://financialmodelingprep.com/developer/docs/dashboard) + By default it will use the 'demo' API Key that is limited and not all endpoints will work. + + + + + Gets or sets the maximum allowed of requests per second. + By default the max allowed is 10. If you have a different rate limit you can configure it here. + See Rate Limitation #15 https://financialmodelingprep.com/developer/docs/terms-of-service + + + + + Gets or sets the maximum allowed API Calls per second. + You can find the defaults on the pricing documentation. + By default we use the 300 "starter" limit. + https://financialmodelingprep.com/developer/docs/pricing + + + + + Error message if any occured + + + + + True if there was an error with the request otherwise false + + + + + The FMP API response object + + + + diff --git a/FinancialModelingPrepApi/FinancialModelingPrepApi.csproj b/FinancialModelingPrepApi/FinancialModelingPrepApi.csproj index bcea8f6..1da5de8 100644 --- a/FinancialModelingPrepApi/FinancialModelingPrepApi.csproj +++ b/FinancialModelingPrepApi/FinancialModelingPrepApi.csproj @@ -1,54 +1,56 @@  - - net5.0 - MatthiWare.FinancialModelingPrep - False - True - MatthiWare - MatthiWare.FinancialModelingPrep - FinancialModelingPrep API Client written in .NET 5 - Copyright Matthias Beerens 2021 - FinancialModelingPrep API Client - Matthias Beerens - LICENSE - https://github.com/MatthiWare/FinancialModelingPrep.NET - git - FinancialModelingPrep stock quote finance-api - https://github.com/MatthiWare/FinancialModelingPrep.NET - - - GetEnterpriseValueAsync Type fixed - - FinancialModelingPrep - + + net8.0 + MatthiWare.FinancialModelingPrep + true + true + + + MatthiWare, 1130 Labs + FinancialModelingPrepExtended + 0.2.0 + FinancialModelingPrep API Client. + MIT + FinancialModelingPrep API Client + Matthias Beerens, 1130 Labs + LICENSE + https://github.com/mccabe93/FinancialModelingPrepExtended + git + FinancialModelingPrep stock quote finance-api + https://github.com/MatthiWare/FinancialModelingPrep.NET + + - GetEnterpriseValueAsync Type fixed + + FinancialModelingPrepExtended + AnyCPU;x86;x64 + Debug;Release;multi-launch + - - D:\Source\Repos\FinancialModelingPrep.NET\FinancialModelingPrepApi\FinancialModelingPrepApi.xml - + + ./FinancialModelingPrep.NET/FinancialModelingPrepApi/FinancialModelingPrepApi.xml + - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + + ./FinancialModelingPrep.NET/FinancialModelingPrepApi/FinancialModelingPrepApi.xml + - - true - v - true - normal - + + ./FinancialModelingPrep.NET/FinancialModelingPrepApi/FinancialModelingPrepApi.xml + - - - True - - - + + + + + + + + + + True + + + diff --git a/FinancialModelingPrepApi/Model/AdvancedData/CommitmentOfTradersResponse.cs b/FinancialModelingPrepApi/Model/AdvancedData/CommitmentOfTradersResponse.cs new file mode 100644 index 0000000..02103d9 --- /dev/null +++ b/FinancialModelingPrepApi/Model/AdvancedData/CommitmentOfTradersResponse.cs @@ -0,0 +1,399 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json.Serialization; +using System.Threading.Tasks; + +namespace MatthiWare.FinancialModelingPrep.Model.AdvancedData +{ + public class CommitmentOfTradersResponse + { + [JsonPropertyName("symbol")] + public string Symbol { get; set; } + + [JsonPropertyName("date")] + public string Date { get; set; } + + [JsonPropertyName("short_name")] + public string ShortName { get; set; } + + [JsonPropertyName("sector")] + public string Sector { get; set; } + + [JsonPropertyName("market_and_exchange_names")] + public string MarketAndExchangeNames { get; set; } + + [JsonPropertyName("as_of_date_in_form_yymmdd")] + public string AsOfDateInFormYymmdd { get; set; } + + [JsonPropertyName("cftc_contract_market_code")] + public string CftcContractMarketCode { get; set; } + + [JsonPropertyName("cftc_market_code")] + public string CftcMarketCode { get; set; } + + [JsonPropertyName("cftc_region_code")] + public string CftcRegionCode { get; set; } + + [JsonPropertyName("cftc_commodity_code")] + public string CftcCommodityCode { get; set; } + + [JsonPropertyName("open_interest_all")] + public int OpenInterestAll { get; set; } + + [JsonPropertyName("noncomm_positions_long_all")] + public int NoncommPositionsLongAll { get; set; } + + [JsonPropertyName("noncomm_positions_short_all")] + public int NoncommPositionsShortAll { get; set; } + + [JsonPropertyName("noncomm_postions_spread_all")] + public int NoncommPostionsSpreadAll { get; set; } + + [JsonPropertyName("comm_positions_long_all")] + public int CommPositionsLongAll { get; set; } + + [JsonPropertyName("comm_positions_short_all")] + public int CommPositionsShortAll { get; set; } + + [JsonPropertyName("tot_rept_positions_long_all")] + public int TotReptPositionsLongAll { get; set; } + + [JsonPropertyName("tot_rept_positions_short_all")] + public int TotReptPositionsShortAll { get; set; } + + [JsonPropertyName("nonrept_positions_long_all")] + public int NonreptPositionsLongAll { get; set; } + + [JsonPropertyName("nonrept_positions_short_all")] + public int NonreptPositionsShortAll { get; set; } + + [JsonPropertyName("open_interest_old")] + public int OpenInterestOld { get; set; } + + [JsonPropertyName("noncomm_positions_long_old")] + public int NoncommPositionsLongOld { get; set; } + + [JsonPropertyName("noncomm_positions_short_old")] + public int NoncommPositionsShortOld { get; set; } + + [JsonPropertyName("noncomm_positions_spread_old")] + public int NoncommPositionsSpreadOld { get; set; } + + [JsonPropertyName("comm_positions_long_old")] + public int CommPositionsLongOld { get; set; } + + [JsonPropertyName("comm_positions_short_old")] + public int CommPositionsShortOld { get; set; } + + [JsonPropertyName("tot_rept_positions_long_old")] + public int TotReptPositionsLongOld { get; set; } + + [JsonPropertyName("tot_rept_positions_short_old")] + public int TotReptPositionsShortOld { get; set; } + + [JsonPropertyName("nonrept_positions_long_old")] + public int NonreptPositionsLongOld { get; set; } + + [JsonPropertyName("nonrept_positions_short_old")] + public int NonreptPositionsShortOld { get; set; } + + [JsonPropertyName("open_interest_other")] + public int OpenInterestOther { get; set; } + + [JsonPropertyName("noncomm_positions_long_other")] + public int NoncommPositionsLongOther { get; set; } + + [JsonPropertyName("noncomm_positions_short_other")] + public int NoncommPositionsShortOther { get; set; } + + [JsonPropertyName("noncomm_positions_spread_other")] + public int NoncommPositionsSpreadOther { get; set; } + + [JsonPropertyName("comm_positions_long_other")] + public int CommPositionsLongOther { get; set; } + + [JsonPropertyName("comm_positions_short_other")] + public int CommPositionsShortOther { get; set; } + + [JsonPropertyName("tot_rept_positions_long_other")] + public int TotReptPositionsLongOther { get; set; } + + [JsonPropertyName("tot_rept_positions_short_other")] + public int TotReptPositionsShortOther { get; set; } + + [JsonPropertyName("nonrept_positions_long_other")] + public int NonreptPositionsLongOther { get; set; } + + [JsonPropertyName("nonrept_positions_short_other")] + public int NonreptPositionsShortOther { get; set; } + + [JsonPropertyName("change_in_open_interest_all")] + public int ChangeInOpenInterestAll { get; set; } + + [JsonPropertyName("change_in_noncomm_long_all")] + public int ChangeInNoncommLongAll { get; set; } + + [JsonPropertyName("change_in_noncomm_short_all")] + public int ChangeInNoncommShortAll { get; set; } + + [JsonPropertyName("change_in_noncomm_spead_all")] + public int ChangeInNoncommSpeadAll { get; set; } + + [JsonPropertyName("change_in_comm_long_all")] + public int ChangeInCommLongAll { get; set; } + + [JsonPropertyName("change_in_comm_short_all")] + public int ChangeInCommShortAll { get; set; } + + [JsonPropertyName("change_in_tot_rept_long_all")] + public int ChangeInTotReptLongAll { get; set; } + + [JsonPropertyName("change_in_tot_rept_short_all")] + public int ChangeInTotReptShortAll { get; set; } + + [JsonPropertyName("change_in_nonrept_long_all")] + public int ChangeInNonreptLongAll { get; set; } + + [JsonPropertyName("change_in_nonrept_short_all")] + public int ChangeInNonreptShortAll { get; set; } + + [JsonPropertyName("pct_of_open_interest_all")] + public int PctOfOpenInterestAll { get; set; } + + [JsonPropertyName("pct_of_oi_noncomm_long_all")] + public double PctOfOiNoncommLongAll { get; set; } + + [JsonPropertyName("pct_of_oi_noncomm_short_all")] + public double PctOfOiNoncommShortAll { get; set; } + + [JsonPropertyName("pct_of_oi_noncomm_spread_all")] + public double PctOfOiNoncommSpreadAll { get; set; } + + [JsonPropertyName("pct_of_oi_comm_long_all")] + public double PctOfOiCommLongAll { get; set; } + + [JsonPropertyName("pct_of_oi_comm_short_all")] + public double PctOfOiCommShortAll { get; set; } + + [JsonPropertyName("pct_of_oi_tot_rept_long_all")] + public double PctOfOiTotReptLongAll { get; set; } + + [JsonPropertyName("pct_of_oi_tot_rept_short_all")] + public double PctOfOiTotReptShortAll { get; set; } + + [JsonPropertyName("pct_of_oi_nonrept_long_all")] + public double PctOfOiNonreptLongAll { get; set; } + + [JsonPropertyName("pct_of_oi_nonrept_short_all")] + public double PctOfOiNonreptShortAll { get; set; } + + [JsonPropertyName("pct_of_open_interest_ol")] + public int PctOfOpenInterestOl { get; set; } + + [JsonPropertyName("pct_of_oi_noncomm_long_ol")] + public double PctOfOiNoncommLongOl { get; set; } + + [JsonPropertyName("pct_of_oi_noncomm_short_ol")] + public double PctOfOiNoncommShortOl { get; set; } + + [JsonPropertyName("pct_of_oi_noncomm_spread_ol")] + public double PctOfOiNoncommSpreadOl { get; set; } + + [JsonPropertyName("pct_of_oi_comm_long_ol")] + public double PctOfOiCommLongOl { get; set; } + + [JsonPropertyName("pct_of_oi_comm_short_ol")] + public double PctOfOiCommShortOl { get; set; } + + [JsonPropertyName("pct_of_oi_tot_rept_long_ol")] + public double PctOfOiTotReptLongOl { get; set; } + + [JsonPropertyName("pct_of_oi_tot_rept_short_ol")] + public double PctOfOiTotReptShortOl { get; set; } + + [JsonPropertyName("pct_of_oi_nonrept_long_ol")] + public double PctOfOiNonreptLongOl { get; set; } + + [JsonPropertyName("pct_of_oi_nonrept_short_ol")] + public double PctOfOiNonreptShortOl { get; set; } + + [JsonPropertyName("pct_of_open_interest_other")] + public int PctOfOpenInterestOther { get; set; } + + [JsonPropertyName("pct_of_oi_noncomm_long_other")] + public int PctOfOiNoncommLongOther { get; set; } + + [JsonPropertyName("pct_of_oi_noncomm_short_other")] + public int PctOfOiNoncommShortOther { get; set; } + + [JsonPropertyName("pct_of_oi_noncomm_spread_other")] + public int PctOfOiNoncommSpreadOther { get; set; } + + [JsonPropertyName("pct_of_oi_comm_long_other")] + public int PctOfOiCommLongOther { get; set; } + + [JsonPropertyName("pct_of_oi_comm_short_other")] + public int PctOfOiCommShortOther { get; set; } + + [JsonPropertyName("pct_of_oi_tot_rept_long_other")] + public int PctOfOiTotReptLongOther { get; set; } + + [JsonPropertyName("pct_of_oi_tot_rept_short_other")] + public int PctOfOiTotReptShortOther { get; set; } + + [JsonPropertyName("pct_of_oi_nonrept_long_other")] + public int PctOfOiNonreptLongOther { get; set; } + + [JsonPropertyName("pct_of_oi_nonrept_short_other")] + public int PctOfOiNonreptShortOther { get; set; } + + [JsonPropertyName("traders_tot_all")] + public int TradersTotAll { get; set; } + + [JsonPropertyName("traders_noncomm_long_all")] + public int TradersNoncommLongAll { get; set; } + + [JsonPropertyName("traders_noncomm_short_all")] + public int TradersNoncommShortAll { get; set; } + + [JsonPropertyName("traders_noncomm_spread_all")] + public int TradersNoncommSpreadAll { get; set; } + + [JsonPropertyName("traders_comm_long_all")] + public int TradersCommLongAll { get; set; } + + [JsonPropertyName("traders_comm_short_all")] + public int TradersCommShortAll { get; set; } + + [JsonPropertyName("traders_tot_rept_long_all")] + public int TradersTotReptLongAll { get; set; } + + [JsonPropertyName("traders_tot_rept_short_all")] + public int TradersTotReptShortAll { get; set; } + + [JsonPropertyName("traders_tot_ol")] + public int TradersTotOl { get; set; } + + [JsonPropertyName("traders_noncomm_long_ol")] + public int TradersNoncommLongOl { get; set; } + + [JsonPropertyName("traders_noncomm_short_ol")] + public int TradersNoncommShortOl { get; set; } + + [JsonPropertyName("traders_noncomm_spead_ol")] + public int TradersNoncommSpeadOl { get; set; } + + [JsonPropertyName("traders_comm_long_ol")] + public int TradersCommLongOl { get; set; } + + [JsonPropertyName("traders_comm_short_ol")] + public int TradersCommShortOl { get; set; } + + [JsonPropertyName("traders_tot_rept_long_ol")] + public int TradersTotReptLongOl { get; set; } + + [JsonPropertyName("traders_tot_rept_short_ol")] + public int TradersTotReptShortOl { get; set; } + + [JsonPropertyName("traders_tot_other")] + public int TradersTotOther { get; set; } + + [JsonPropertyName("traders_noncomm_long_other")] + public int TradersNoncommLongOther { get; set; } + + [JsonPropertyName("traders_noncomm_short_other")] + public int TradersNoncommShortOther { get; set; } + + [JsonPropertyName("traders_noncomm_spread_other")] + public int TradersNoncommSpreadOther { get; set; } + + [JsonPropertyName("traders_comm_long_other")] + public int TradersCommLongOther { get; set; } + + [JsonPropertyName("traders_comm_short_other")] + public int TradersCommShortOther { get; set; } + + [JsonPropertyName("traders_tot_rept_long_other")] + public int TradersTotReptLongOther { get; set; } + + [JsonPropertyName("traders_tot_rept_short_other")] + public int TradersTotReptShortOther { get; set; } + + [JsonPropertyName("conc_gross_le_4_tdr_long_all")] + public double ConcGrossLe4TdrLongAll { get; set; } + + [JsonPropertyName("conc_gross_le_4_tdr_short_all")] + public double ConcGrossLe4TdrShortAll { get; set; } + + [JsonPropertyName("conc_gross_le_8_tdr_long_all")] + public double ConcGrossLe8TdrLongAll { get; set; } + + [JsonPropertyName("conc_gross_le_8_tdr_short_all")] + public double ConcGrossLe8TdrShortAll { get; set; } + + [JsonPropertyName("conc_net_le_4_tdr_long_all")] + public double ConcNetLe4TdrLongAll { get; set; } + + [JsonPropertyName("conc_net_le_4_tdr_short_all")] + public double ConcNetLe4TdrShortAll { get; set; } + + [JsonPropertyName("conc_net_le_8_tdr_long_all")] + public double ConcNetLe8TdrLongAll { get; set; } + + [JsonPropertyName("conc_net_le_8_tdr_short_all")] + public double ConcNetLe8TdrShortAll { get; set; } + + [JsonPropertyName("conc_gross_le_4_tdr_long_ol")] + public double ConcGrossLe4TdrLongOl { get; set; } + + [JsonPropertyName("conc_gross_le_4_tdr_short_ol")] + public double ConcGrossLe4TdrShortOl { get; set; } + + [JsonPropertyName("conc_gross_le_8_tdr_long_ol")] + public double ConcGrossLe8TdrLongOl { get; set; } + + [JsonPropertyName("conc_gross_le_8_tdr_short_ol")] + public double ConcGrossLe8TdrShortOl { get; set; } + + [JsonPropertyName("conc_net_le_4_tdr_long_ol")] + public double ConcNetLe4TdrLongOl { get; set; } + + [JsonPropertyName("conc_net_le_4_tdr_short_ol")] + public double ConcNetLe4TdrShortOl { get; set; } + + [JsonPropertyName("conc_net_le_8_tdr_long_ol")] + public double ConcNetLe8TdrLongOl { get; set; } + + [JsonPropertyName("conc_net_le_8_tdr_short_ol")] + public double ConcNetLe8TdrShortOl { get; set; } + + [JsonPropertyName("conc_gross_le_4_tdr_long_other")] + public int ConcGrossLe4TdrLongOther { get; set; } + + [JsonPropertyName("conc_gross_le_4_tdr_short_other")] + public int ConcGrossLe4TdrShortOther { get; set; } + + [JsonPropertyName("conc_gross_le_8_tdr_long_other")] + public int ConcGrossLe8TdrLongOther { get; set; } + + [JsonPropertyName("conc_gross_le_8_tdr_short_other")] + public int ConcGrossLe8TdrShortOther { get; set; } + + [JsonPropertyName("conc_net_le_4_tdr_long_other")] + public int ConcNetLe4TdrLongOther { get; set; } + + [JsonPropertyName("conc_net_le_4_tdr_short_other")] + public int ConcNetLe4TdrShortOther { get; set; } + + [JsonPropertyName("conc_net_le_8_tdr_long_other")] + public int ConcNetLe8TdrLongOther { get; set; } + + [JsonPropertyName("conc_net_le_8_tdr_short_other")] + public int ConcNetLe8TdrShortOther { get; set; } + + [JsonPropertyName("contract_units")] + public string ContractUnits { get; set; } + } +} diff --git a/FinancialModelingPrepApi/Model/AdvancedData/ESGScoreResponse.cs b/FinancialModelingPrepApi/Model/AdvancedData/ESGScoreResponse.cs index ad919ad..304f2d7 100644 --- a/FinancialModelingPrepApi/Model/AdvancedData/ESGScoreResponse.cs +++ b/FinancialModelingPrepApi/Model/AdvancedData/ESGScoreResponse.cs @@ -23,16 +23,16 @@ public class ESGScoreResponse public string Date { get; set; } [JsonPropertyName("environmentalScore")] - public double EnvironmentalScore { get; set; } + public decimal EnvironmentalScore { get; set; } [JsonPropertyName("socialScore")] - public double SocialScore { get; set; } + public decimal SocialScore { get; set; } [JsonPropertyName("governanceScore")] - public double GovernanceScore { get; set; } + public decimal GovernanceScore { get; set; } [JsonPropertyName("ESGScore")] - public double ESGScore { get; set; } + public decimal ESGScore { get; set; } [JsonPropertyName("url")] public string Url { get; set; } diff --git a/FinancialModelingPrepApi/Model/AdvancedData/FinancialScoreResponse.cs b/FinancialModelingPrepApi/Model/AdvancedData/FinancialScoreResponse.cs new file mode 100644 index 0000000..40d3702 --- /dev/null +++ b/FinancialModelingPrepApi/Model/AdvancedData/FinancialScoreResponse.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json.Serialization; +using System.Threading.Tasks; + +namespace MatthiWare.FinancialModelingPrep.Model.AdvancedData +{ + public class FinancialScoreResponse + { + [JsonPropertyName("symbol")] + public string Symbol { get; set; } + + [JsonPropertyName("altmanZScore")] + public decimal AltmanZScore { get; set; } + + [JsonPropertyName("piotroskiScore")] + public decimal PiotroskiScore { get; set; } + + [JsonPropertyName("workingCapital")] + public decimal WorkingCapital { get; set; } + + [JsonPropertyName("totalAssets")] + public decimal TotalAssets { get; set; } + + [JsonPropertyName("retainedEarnings")] + public decimal RetainedEarnings { get; set; } + + [JsonPropertyName("ebit")] + public decimal Ebit { get; set; } + + [JsonPropertyName("totalLiabilities")] + public decimal TotalLiabilities { get; set; } + + [JsonPropertyName("revenue")] + public decimal Revenue { get; set; } + } +} diff --git a/FinancialModelingPrepApi/Model/AdvancedData/SharesFloatResponse.cs b/FinancialModelingPrepApi/Model/AdvancedData/SharesFloatResponse.cs index f6be94b..b0a04ae 100644 --- a/FinancialModelingPrepApi/Model/AdvancedData/SharesFloatResponse.cs +++ b/FinancialModelingPrepApi/Model/AdvancedData/SharesFloatResponse.cs @@ -11,13 +11,13 @@ public class SharesFloatResponse public string Date { get; set; } [JsonPropertyName("freeFloat")] - public double FreeFloat { get; set; } + public decimal FreeFloat { get; set; } [JsonPropertyName("floatShares")] - public double FloatShares { get; set; } + public decimal FloatShares { get; set; } [JsonPropertyName("outstandingShares")] - public double OutstandingShares { get; set; } + public decimal OutstandingShares { get; set; } [JsonPropertyName("source")] public string Source { get; set; } diff --git a/FinancialModelingPrepApi/Model/ApiResponse.cs b/FinancialModelingPrepApi/Model/ApiResponse.cs index be7e012..1e1aa59 100644 --- a/FinancialModelingPrepApi/Model/ApiResponse.cs +++ b/FinancialModelingPrepApi/Model/ApiResponse.cs @@ -8,7 +8,7 @@ public static ApiResponse FromError(string error) where TRetur Error = error }; - public static ApiResponse FromSucces(TReturn data) where TReturn : class + public static ApiResponse FromSuccess(TReturn data) where TReturn : class => new() { Data = data diff --git a/FinancialModelingPrepApi/Model/Calendars/DividendCalendarResponse.cs b/FinancialModelingPrepApi/Model/Calendars/DividendCalendarResponse.cs index fc71be2..ed7eab2 100644 --- a/FinancialModelingPrepApi/Model/Calendars/DividendCalendarResponse.cs +++ b/FinancialModelingPrepApi/Model/Calendars/DividendCalendarResponse.cs @@ -11,13 +11,13 @@ public class DividendCalendarResponse public string Label { get; set; } [JsonPropertyName("adjDividend")] - public double AdjDividend { get; set; } + public decimal AdjDividend { get; set; } [JsonPropertyName("symbol")] public string Symbol { get; set; } [JsonPropertyName("dividend")] - public double? Dividend { get; set; } + public decimal? Dividend { get; set; } [JsonPropertyName("recordDate")] public string RecordDate { get; set; } diff --git a/FinancialModelingPrepApi/Model/Calendars/EconomicCalendarResponse.cs b/FinancialModelingPrepApi/Model/Calendars/EconomicCalendarResponse.cs index 45c3bfc..dac4afa 100644 --- a/FinancialModelingPrepApi/Model/Calendars/EconomicCalendarResponse.cs +++ b/FinancialModelingPrepApi/Model/Calendars/EconomicCalendarResponse.cs @@ -14,18 +14,20 @@ public class EconomicCalendarResponse public string Country { get; set; } [JsonPropertyName("actual")] - public double? Actual { get; set; } + public decimal? Actual { get; set; } [JsonPropertyName("previous")] - public double? Previous { get; set; } + public decimal? Previous { get; set; } [JsonPropertyName("change")] - public double? Change { get; set; } + public decimal? Change { get; set; } [JsonPropertyName("changePercentage")] - public double? ChangePercentage { get; set; } + public decimal? ChangePercentage { get; set; } [JsonPropertyName("estimate")] - public double? Estimate { get; set; } + public decimal? Estimate { get; set; } + [JsonPropertyName("impact")] + public string? Impact { get; set; } } } diff --git a/FinancialModelingPrepApi/Model/Calendars/IPOCalendarResponse.cs b/FinancialModelingPrepApi/Model/Calendars/IPOCalendarResponse.cs index 6cfed4f..d51e571 100644 --- a/FinancialModelingPrepApi/Model/Calendars/IPOCalendarResponse.cs +++ b/FinancialModelingPrepApi/Model/Calendars/IPOCalendarResponse.cs @@ -26,6 +26,6 @@ public class IPOCalendarResponse public string PriceRange { get; set; } [JsonPropertyName("marketCap")] - public double? MarketCap { get; set; } + public decimal? MarketCap { get; set; } } } diff --git a/FinancialModelingPrepApi/Model/Calendars/StockSplitCalendarResponse.cs b/FinancialModelingPrepApi/Model/Calendars/StockSplitCalendarResponse.cs index d5d7d59..f4551a9 100644 --- a/FinancialModelingPrepApi/Model/Calendars/StockSplitCalendarResponse.cs +++ b/FinancialModelingPrepApi/Model/Calendars/StockSplitCalendarResponse.cs @@ -14,9 +14,9 @@ public class StockSplitCalendarResponse public string Symbol { get; set; } [JsonPropertyName("numerator")] - public double Numerator { get; set; } + public decimal Numerator { get; set; } [JsonPropertyName("denominator")] - public double Denominator { get; set; } + public decimal Denominator { get; set; } } } diff --git a/FinancialModelingPrepApi/Model/CompanyValuation/BalanceSheetResponse.cs b/FinancialModelingPrepApi/Model/CompanyValuation/BalanceSheetResponse.cs index 7027fd7..aa1a3a6 100644 --- a/FinancialModelingPrepApi/Model/CompanyValuation/BalanceSheetResponse.cs +++ b/FinancialModelingPrepApi/Model/CompanyValuation/BalanceSheetResponse.cs @@ -29,136 +29,136 @@ public class BalanceSheetResponse public string Period { get; set; } [JsonPropertyName("cashAndCashEquivalents")] - public double CashAndCashEquivalents { get; set; } + public decimal CashAndCashEquivalents { get; set; } [JsonPropertyName("shortTermInvestments")] - public double ShortTermInvestments { get; set; } + public decimal ShortTermInvestments { get; set; } [JsonPropertyName("cashAndShortTermInvestments")] - public double CashAndShortTermInvestments { get; set; } + public decimal CashAndShortTermInvestments { get; set; } [JsonPropertyName("netReceivables")] - public double NetReceivables { get; set; } + public decimal NetReceivables { get; set; } [JsonPropertyName("inventory")] - public double Inventory { get; set; } + public decimal Inventory { get; set; } [JsonPropertyName("otherCurrentAssets")] - public double OtherCurrentAssets { get; set; } + public decimal OtherCurrentAssets { get; set; } [JsonPropertyName("totalCurrentAssets")] - public double TotalCurrentAssets { get; set; } + public decimal TotalCurrentAssets { get; set; } [JsonPropertyName("propertyPlantEquipmentNet")] - public double PropertyPlantEquipmentNet { get; set; } + public decimal PropertyPlantEquipmentNet { get; set; } [JsonPropertyName("goodwill")] - public double Goodwill { get; set; } + public decimal Goodwill { get; set; } [JsonPropertyName("intangibleAssets")] - public double IntangibleAssets { get; set; } + public decimal IntangibleAssets { get; set; } [JsonPropertyName("goodwillAndIntangibleAssets")] - public double GoodwillAndIntangibleAssets { get; set; } + public decimal GoodwillAndIntangibleAssets { get; set; } [JsonPropertyName("longTermInvestments")] - public double LongTermInvestments { get; set; } + public decimal LongTermInvestments { get; set; } [JsonPropertyName("taxAssets")] - public double TaxAssets { get; set; } + public decimal TaxAssets { get; set; } [JsonPropertyName("otherNonCurrentAssets")] - public double OtherNonCurrentAssets { get; set; } + public decimal OtherNonCurrentAssets { get; set; } [JsonPropertyName("totalNonCurrentAssets")] - public double TotalNonCurrentAssets { get; set; } + public decimal TotalNonCurrentAssets { get; set; } [JsonPropertyName("otherAssets")] - public double OtherAssets { get; set; } + public decimal OtherAssets { get; set; } [JsonPropertyName("totalAssets")] - public double TotalAssets { get; set; } + public decimal TotalAssets { get; set; } [JsonPropertyName("accountPayables")] - public double AccountPayables { get; set; } + public decimal AccountPayables { get; set; } [JsonPropertyName("shortTermDebt")] - public double ShortTermDebt { get; set; } + public decimal ShortTermDebt { get; set; } [JsonPropertyName("taxPayables")] - public double TaxPayables { get; set; } + public decimal TaxPayables { get; set; } [JsonPropertyName("deferredRevenue")] - public double DeferredRevenue { get; set; } + public decimal DeferredRevenue { get; set; } [JsonPropertyName("otherCurrentLiabilities")] - public double OtherCurrentLiabilities { get; set; } + public decimal OtherCurrentLiabilities { get; set; } [JsonPropertyName("totalCurrentLiabilities")] - public double TotalCurrentLiabilities { get; set; } + public decimal TotalCurrentLiabilities { get; set; } [JsonPropertyName("longTermDebt")] - public double LongTermDebt { get; set; } + public decimal LongTermDebt { get; set; } [JsonPropertyName("deferredRevenueNonCurrent")] - public double DeferredRevenueNonCurrent { get; set; } + public decimal DeferredRevenueNonCurrent { get; set; } [JsonPropertyName("deferredTaxLiabilitiesNonCurrent")] - public double DeferredTaxLiabilitiesNonCurrent { get; set; } + public decimal DeferredTaxLiabilitiesNonCurrent { get; set; } [JsonPropertyName("otherNonCurrentLiabilities")] - public double OtherNonCurrentLiabilities { get; set; } + public decimal OtherNonCurrentLiabilities { get; set; } [JsonPropertyName("totalNonCurrentLiabilities")] - public double TotalNonCurrentLiabilities { get; set; } + public decimal TotalNonCurrentLiabilities { get; set; } [JsonPropertyName("otherLiabilities")] - public double OtherLiabilities { get; set; } + public decimal OtherLiabilities { get; set; } [JsonPropertyName("capitalLeaseObligations")] - public double CapitalLeaseObligations { get; set; } + public decimal CapitalLeaseObligations { get; set; } [JsonPropertyName("totalLiabilities")] - public double TotalLiabilities { get; set; } + public decimal TotalLiabilities { get; set; } [JsonPropertyName("preferredStock")] - public double PreferredStock { get; set; } + public decimal PreferredStock { get; set; } [JsonPropertyName("commonStock")] - public double CommonStock { get; set; } + public decimal CommonStock { get; set; } [JsonPropertyName("retainedEarnings")] - public double RetainedEarnings { get; set; } + public decimal RetainedEarnings { get; set; } [JsonPropertyName("accumulatedOtherComprehensiveIncomeLoss")] - public double AccumulatedOtherComprehensiveIncomeLoss { get; set; } + public decimal AccumulatedOtherComprehensiveIncomeLoss { get; set; } [JsonPropertyName("othertotalStockholdersEquity")] - public double OthertotalStockholdersEquity { get; set; } + public decimal OthertotalStockholdersEquity { get; set; } [JsonPropertyName("totalStockholdersEquity")] - public double TotalStockholdersEquity { get; set; } + public decimal TotalStockholdersEquity { get; set; } [JsonPropertyName("totalLiabilitiesAndStockholdersEquity")] - public double TotalLiabilitiesAndStockholdersEquity { get; set; } + public decimal TotalLiabilitiesAndStockholdersEquity { get; set; } [JsonPropertyName("minorityInterest")] - public double MinorityInterest { get; set; } + public decimal MinorityInterest { get; set; } [JsonPropertyName("totalEquity")] - public double TotalEquity { get; set; } + public decimal TotalEquity { get; set; } [JsonPropertyName("totalLiabilitiesAndTotalEquity")] - public double TotalLiabilitiesAndTotalEquity { get; set; } + public decimal TotalLiabilitiesAndTotalEquity { get; set; } [JsonPropertyName("totalInvestments")] - public double TotalInvestments { get; set; } + public decimal TotalInvestments { get; set; } [JsonPropertyName("totalDebt")] - public double TotalDebt { get; set; } + public decimal TotalDebt { get; set; } [JsonPropertyName("netDebt")] - public double NetDebt { get; set; } + public decimal NetDebt { get; set; } [JsonPropertyName("link")] public string Link { get; set; } diff --git a/FinancialModelingPrepApi/Model/CompanyValuation/CashFlowResponse.cs b/FinancialModelingPrepApi/Model/CompanyValuation/CashFlowResponse.cs index 85cde0d..52ad41f 100644 --- a/FinancialModelingPrepApi/Model/CompanyValuation/CashFlowResponse.cs +++ b/FinancialModelingPrepApi/Model/CompanyValuation/CashFlowResponse.cs @@ -29,94 +29,94 @@ public class CashFlowResponse public string Period { get; set; } [JsonPropertyName("netIncome")] - public double NetIncome { get; set; } + public decimal NetIncome { get; set; } [JsonPropertyName("depreciationAndAmortization")] - public double DepreciationAndAmortization { get; set; } + public decimal DepreciationAndAmortization { get; set; } [JsonPropertyName("deferredIncomeTax")] - public double DeferredIncomeTax { get; set; } + public decimal DeferredIncomeTax { get; set; } [JsonPropertyName("stockBasedCompensation")] - public double StockBasedCompensation { get; set; } + public decimal StockBasedCompensation { get; set; } [JsonPropertyName("changeInWorkingCapital")] - public double ChangeInWorkingCapital { get; set; } + public decimal ChangeInWorkingCapital { get; set; } [JsonPropertyName("accountsReceivables")] - public double AccountsReceivables { get; set; } + public decimal AccountsReceivables { get; set; } [JsonPropertyName("inventory")] - public double Inventory { get; set; } + public decimal Inventory { get; set; } [JsonPropertyName("accountsPayables")] - public double AccountsPayables { get; set; } + public decimal AccountsPayables { get; set; } [JsonPropertyName("otherWorkingCapital")] - public double OtherWorkingCapital { get; set; } + public decimal OtherWorkingCapital { get; set; } [JsonPropertyName("otherNonCashItems")] - public double OtherNonCashItems { get; set; } + public decimal OtherNonCashItems { get; set; } [JsonPropertyName("netCashProvidedByOperatingActivities")] - public double NetCashProvidedByOperatingActivities { get; set; } + public decimal NetCashProvidedByOperatingActivities { get; set; } [JsonPropertyName("investmentsInPropertyPlantAndEquipment")] - public double InvestmentsInPropertyPlantAndEquipment { get; set; } + public decimal InvestmentsInPropertyPlantAndEquipment { get; set; } [JsonPropertyName("acquisitionsNet")] - public double AcquisitionsNet { get; set; } + public decimal AcquisitionsNet { get; set; } [JsonPropertyName("purchasesOfInvestments")] - public double PurchasesOfInvestments { get; set; } + public decimal PurchasesOfInvestments { get; set; } [JsonPropertyName("salesMaturitiesOfInvestments")] - public double SalesMaturitiesOfInvestments { get; set; } + public decimal SalesMaturitiesOfInvestments { get; set; } [JsonPropertyName("otherInvestingActivites")] - public double OtherInvestingActivites { get; set; } + public decimal OtherInvestingActivites { get; set; } [JsonPropertyName("netCashUsedForInvestingActivites")] - public double NetCashUsedForInvestingActivites { get; set; } + public decimal NetCashUsedForInvestingActivites { get; set; } [JsonPropertyName("debtRepayment")] - public double DebtRepayment { get; set; } + public decimal DebtRepayment { get; set; } [JsonPropertyName("commonStockIssued")] - public double CommonStockIssued { get; set; } + public decimal CommonStockIssued { get; set; } [JsonPropertyName("commonStockRepurchased")] - public double CommonStockRepurchased { get; set; } + public decimal CommonStockRepurchased { get; set; } [JsonPropertyName("dividendsPaid")] - public double DividendsPaid { get; set; } + public decimal DividendsPaid { get; set; } [JsonPropertyName("otherFinancingActivites")] - public double OtherFinancingActivites { get; set; } + public decimal OtherFinancingActivites { get; set; } [JsonPropertyName("netCashUsedProvidedByFinancingActivities")] - public double NetCashUsedProvidedByFinancingActivities { get; set; } + public decimal NetCashUsedProvidedByFinancingActivities { get; set; } [JsonPropertyName("effectOfForexChangesOnCash")] - public double EffectOfForexChangesOnCash { get; set; } + public decimal EffectOfForexChangesOnCash { get; set; } [JsonPropertyName("netChangeInCash")] - public double NetChangeInCash { get; set; } + public decimal NetChangeInCash { get; set; } [JsonPropertyName("cashAtEndOfPeriod")] - public double CashAtEndOfPeriod { get; set; } + public decimal CashAtEndOfPeriod { get; set; } [JsonPropertyName("cashAtBeginningOfPeriod")] - public double CashAtBeginningOfPeriod { get; set; } + public decimal CashAtBeginningOfPeriod { get; set; } [JsonPropertyName("operatingCashFlow")] - public double OperatingCashFlow { get; set; } + public decimal OperatingCashFlow { get; set; } [JsonPropertyName("capitalExpenditure")] - public double CapitalExpenditure { get; set; } + public decimal CapitalExpenditure { get; set; } [JsonPropertyName("freeCashFlow")] - public double FreeCashFlow { get; set; } + public decimal FreeCashFlow { get; set; } [JsonPropertyName("link")] public string Link { get; set; } diff --git a/FinancialModelingPrepApi/Model/CompanyValuation/CompanyProfileResponse.cs b/FinancialModelingPrepApi/Model/CompanyValuation/CompanyProfileResponse.cs index a175e4a..159ec3e 100644 --- a/FinancialModelingPrepApi/Model/CompanyValuation/CompanyProfileResponse.cs +++ b/FinancialModelingPrepApi/Model/CompanyValuation/CompanyProfileResponse.cs @@ -8,10 +8,10 @@ public class CompanyProfileResponse public string Symbol { get; set; } [JsonPropertyName("price")] - public double Price { get; set; } + public decimal Price { get; set; } [JsonPropertyName("beta")] - public double Beta { get; set; } + public decimal Beta { get; set; } [JsonPropertyName("volAvg")] public int VolAvg { get; set; } @@ -20,13 +20,13 @@ public class CompanyProfileResponse public long MktCap { get; set; } [JsonPropertyName("lastDiv")] - public double LastDiv { get; set; } + public decimal LastDiv { get; set; } [JsonPropertyName("range")] public string Range { get; set; } [JsonPropertyName("changes")] - public double Changes { get; set; } + public decimal Changes { get; set; } [JsonPropertyName("companyName")] public string CompanyName { get; set; } @@ -86,10 +86,10 @@ public class CompanyProfileResponse public string Zip { get; set; } [JsonPropertyName("dcfDiff")] - public double? DcfDiff { get; set; } + public decimal? DcfDiff { get; set; } [JsonPropertyName("dcf")] - public double? Dcf { get; set; } + public decimal? Dcf { get; set; } [JsonPropertyName("image")] public string Image { get; set; } diff --git a/FinancialModelingPrepApi/Model/CompanyValuation/DCFResponse.cs b/FinancialModelingPrepApi/Model/CompanyValuation/DCFResponse.cs index 3977a8e..179775b 100644 --- a/FinancialModelingPrepApi/Model/CompanyValuation/DCFResponse.cs +++ b/FinancialModelingPrepApi/Model/CompanyValuation/DCFResponse.cs @@ -11,9 +11,9 @@ public class DCFResponse public string Date { get; set; } [JsonPropertyName("dcf")] - public double Dcf { get; set; } + public decimal Dcf { get; set; } [JsonPropertyName("StockPrice")] - public double StockPrice { get; set; } + public decimal StockPrice { get; set; } } } diff --git a/FinancialModelingPrepApi/Model/CompanyValuation/EnterpriseValueResponse.cs b/FinancialModelingPrepApi/Model/CompanyValuation/EnterpriseValueResponse.cs index 38dc0b9..3862b40 100644 --- a/FinancialModelingPrepApi/Model/CompanyValuation/EnterpriseValueResponse.cs +++ b/FinancialModelingPrepApi/Model/CompanyValuation/EnterpriseValueResponse.cs @@ -11,21 +11,21 @@ public class EnterpriseValueResponse public string Date { get; set; } [JsonPropertyName("stockPrice")] - public double StockPrice { get; set; } + public decimal StockPrice { get; set; } [JsonPropertyName("numberOfShares")] public long NumberOfShares { get; set; } [JsonPropertyName("marketCapitalization")] - public double MarketCapitalization { get; set; } + public decimal MarketCapitalization { get; set; } [JsonPropertyName("minusCashAndCashEquivalents")] - public double MinusCashAndCashEquivalents { get; set; } + public decimal MinusCashAndCashEquivalents { get; set; } [JsonPropertyName("addTotalDebt")] - public double AddTotalDebt { get; set; } + public decimal AddTotalDebt { get; set; } [JsonPropertyName("enterpriseValue")] - public double EnterpriseValue { get; set; } + public decimal EnterpriseValue { get; set; } } } diff --git a/FinancialModelingPrepApi/Model/CompanyValuation/HistoricalDCFResponse.cs b/FinancialModelingPrepApi/Model/CompanyValuation/HistoricalDCFResponse.cs index 4220533..b3de217 100644 --- a/FinancialModelingPrepApi/Model/CompanyValuation/HistoricalDCFResponse.cs +++ b/FinancialModelingPrepApi/Model/CompanyValuation/HistoricalDCFResponse.cs @@ -12,9 +12,9 @@ public class HistoricalDCFResponse public string Date { get; set; } [JsonPropertyName("price")] - public double Price { get; set; } + public decimal Price { get; set; } [JsonPropertyName("dcf")] - public double? Dcf { get; set; } + public decimal? Dcf { get; set; } } } diff --git a/FinancialModelingPrepApi/Model/CompanyValuation/HistoricalDailyDCFResponse.cs b/FinancialModelingPrepApi/Model/CompanyValuation/HistoricalDailyDCFResponse.cs index f8c3e05..aab8ced 100644 --- a/FinancialModelingPrepApi/Model/CompanyValuation/HistoricalDailyDCFResponse.cs +++ b/FinancialModelingPrepApi/Model/CompanyValuation/HistoricalDailyDCFResponse.cs @@ -11,6 +11,6 @@ public class HistoricalDailyDCFResponse public string Date { get; set; } [JsonPropertyName("dcf")] - public double Dcf { get; set; } + public decimal Dcf { get; set; } } } diff --git a/FinancialModelingPrepApi/Model/CompanyValuation/IncomeStatementResponse.cs b/FinancialModelingPrepApi/Model/CompanyValuation/IncomeStatementResponse.cs index e14db52..e16529a 100644 --- a/FinancialModelingPrepApi/Model/CompanyValuation/IncomeStatementResponse.cs +++ b/FinancialModelingPrepApi/Model/CompanyValuation/IncomeStatementResponse.cs @@ -29,88 +29,88 @@ public class IncomeStatementResponse public string Period { get; set; } [JsonPropertyName("revenue")] - public double Revenue { get; set; } + public decimal Revenue { get; set; } [JsonPropertyName("costOfRevenue")] - public double CostOfRevenue { get; set; } + public decimal CostOfRevenue { get; set; } [JsonPropertyName("grossProfit")] - public double GrossProfit { get; set; } + public decimal GrossProfit { get; set; } [JsonPropertyName("grossProfitRatio")] - public double GrossProfitRatio { get; set; } + public decimal GrossProfitRatio { get; set; } [JsonPropertyName("researchAndDevelopmentExpenses")] - public double ResearchAndDevelopmentExpenses { get; set; } + public decimal ResearchAndDevelopmentExpenses { get; set; } [JsonPropertyName("generalAndAdministrativeExpenses")] - public double GeneralAndAdministrativeExpenses { get; set; } + public decimal GeneralAndAdministrativeExpenses { get; set; } [JsonPropertyName("sellingAndMarketingExpenses")] - public double SellingAndMarketingExpenses { get; set; } + public decimal SellingAndMarketingExpenses { get; set; } [JsonPropertyName("sellingGeneralAndAdministrativeExpenses")] - public double SellingGeneralAndAdministrativeExpenses { get; set; } + public decimal SellingGeneralAndAdministrativeExpenses { get; set; } [JsonPropertyName("otherExpenses")] - public double OtherExpenses { get; set; } + public decimal OtherExpenses { get; set; } [JsonPropertyName("operatingExpenses")] - public double OperatingExpenses { get; set; } + public decimal OperatingExpenses { get; set; } [JsonPropertyName("costAndExpenses")] - public double CostAndExpenses { get; set; } + public decimal CostAndExpenses { get; set; } [JsonPropertyName("interestIncome")] - public double InterestIncome { get; set; } + public decimal InterestIncome { get; set; } [JsonPropertyName("interestExpense")] - public double InterestExpense { get; set; } + public decimal InterestExpense { get; set; } [JsonPropertyName("depreciationAndAmortization")] - public double DepreciationAndAmortization { get; set; } + public decimal DepreciationAndAmortization { get; set; } [JsonPropertyName("ebitda")] - public double Ebitda { get; set; } + public decimal Ebitda { get; set; } [JsonPropertyName("ebitdaratio")] - public double Ebitdaratio { get; set; } + public decimal Ebitdaratio { get; set; } [JsonPropertyName("operatingIncome")] - public double OperatingIncome { get; set; } + public decimal OperatingIncome { get; set; } [JsonPropertyName("operatingIncomeRatio")] - public double OperatingIncomeRatio { get; set; } + public decimal OperatingIncomeRatio { get; set; } [JsonPropertyName("totalOtherIncomeExpensesNet")] - public double TotalOtherIncomeExpensesNet { get; set; } + public decimal TotalOtherIncomeExpensesNet { get; set; } [JsonPropertyName("incomeBeforeTax")] - public double IncomeBeforeTax { get; set; } + public decimal IncomeBeforeTax { get; set; } [JsonPropertyName("incomeBeforeTaxRatio")] - public double IncomeBeforeTaxRatio { get; set; } + public decimal IncomeBeforeTaxRatio { get; set; } [JsonPropertyName("incomeTaxExpense")] - public double IncomeTaxExpense { get; set; } + public decimal IncomeTaxExpense { get; set; } [JsonPropertyName("netIncome")] - public double NetIncome { get; set; } + public decimal NetIncome { get; set; } [JsonPropertyName("netIncomeRatio")] - public double NetIncomeRatio { get; set; } + public decimal NetIncomeRatio { get; set; } [JsonPropertyName("eps")] - public double Eps { get; set; } + public decimal Eps { get; set; } [JsonPropertyName("epsdiluted")] - public double Epsdiluted { get; set; } + public decimal Epsdiluted { get; set; } [JsonPropertyName("weightedAverageShsOut")] - public double WeightedAverageShsOut { get; set; } + public decimal WeightedAverageShsOut { get; set; } [JsonPropertyName("weightedAverageShsOutDil")] - public double WeightedAverageShsOutDil { get; set; } + public decimal WeightedAverageShsOutDil { get; set; } [JsonPropertyName("link")] public string Link { get; set; } diff --git a/FinancialModelingPrepApi/Model/CompanyValuation/KeyMetricsResponse.cs b/FinancialModelingPrepApi/Model/CompanyValuation/KeyMetricsResponse.cs index 5d3e13b..befb579 100644 --- a/FinancialModelingPrepApi/Model/CompanyValuation/KeyMetricsResponse.cs +++ b/FinancialModelingPrepApi/Model/CompanyValuation/KeyMetricsResponse.cs @@ -14,174 +14,174 @@ public class KeyMetricsResponse public string Period { get; set; } [JsonPropertyName("revenuePerShare")] - public double? RevenuePerShare { get; set; } + public decimal? RevenuePerShare { get; set; } [JsonPropertyName("netIncomePerShare")] - public double? NetIncomePerShare { get; set; } + public decimal? NetIncomePerShare { get; set; } [JsonPropertyName("operatingCashFlowPerShare")] - public double? OperatingCashFlowPerShare { get; set; } + public decimal? OperatingCashFlowPerShare { get; set; } [JsonPropertyName("freeCashFlowPerShare")] - public double? FreeCashFlowPerShare { get; set; } + public decimal? FreeCashFlowPerShare { get; set; } [JsonPropertyName("cashPerShare")] - public double? CashPerShare { get; set; } + public decimal? CashPerShare { get; set; } [JsonPropertyName("bookValuePerShare")] - public double? BookValuePerShare { get; set; } + public decimal? BookValuePerShare { get; set; } [JsonPropertyName("tangibleBookValuePerShare")] - public double? TangibleBookValuePerShare { get; set; } + public decimal? TangibleBookValuePerShare { get; set; } [JsonPropertyName("shareholdersEquityPerShare")] - public double? ShareholdersEquityPerShare { get; set; } + public decimal? ShareholdersEquityPerShare { get; set; } [JsonPropertyName("interestDebtPerShare")] - public double? InterestDebtPerShare { get; set; } + public decimal? InterestDebtPerShare { get; set; } [JsonPropertyName("marketCap")] - public double? MarketCap { get; set; } + public decimal? MarketCap { get; set; } [JsonPropertyName("enterpriseValue")] - public double? EnterpriseValue { get; set; } + public decimal? EnterpriseValue { get; set; } [JsonPropertyName("peRatio")] - public double? PeRatio { get; set; } + public decimal? PeRatio { get; set; } [JsonPropertyName("priceToSalesRatio")] - public double? PriceToSalesRatio { get; set; } + public decimal? PriceToSalesRatio { get; set; } [JsonPropertyName("pocfratio")] - public double? Pocfratio { get; set; } + public decimal? Pocfratio { get; set; } [JsonPropertyName("pfcfRatio")] - public double? PfcfRatio { get; set; } + public decimal? PfcfRatio { get; set; } [JsonPropertyName("pbRatio")] - public double? PbRatio { get; set; } + public decimal? PbRatio { get; set; } [JsonPropertyName("ptbRatio")] - public double? PtbRatio { get; set; } + public decimal? PtbRatio { get; set; } [JsonPropertyName("evToSales")] - public double? EvToSales { get; set; } + public decimal? EvToSales { get; set; } [JsonPropertyName("enterpriseValueOverEBITDA")] - public double? EnterpriseValueOverEBITDA { get; set; } + public decimal? EnterpriseValueOverEBITDA { get; set; } [JsonPropertyName("evToOperatingCashFlow")] - public double? EvToOperatingCashFlow { get; set; } + public decimal? EvToOperatingCashFlow { get; set; } [JsonPropertyName("evToFreeCashFlow")] - public double? EvToFreeCashFlow { get; set; } + public decimal? EvToFreeCashFlow { get; set; } [JsonPropertyName("earningsYield")] - public double? EarningsYield { get; set; } + public decimal? EarningsYield { get; set; } [JsonPropertyName("freeCashFlowYield")] - public double? FreeCashFlowYield { get; set; } + public decimal? FreeCashFlowYield { get; set; } [JsonPropertyName("debtToEquity")] - public double? DebtToEquity { get; set; } + public decimal? DebtToEquity { get; set; } [JsonPropertyName("debtToAssets")] - public double? DebtToAssets { get; set; } + public decimal? DebtToAssets { get; set; } [JsonPropertyName("netDebtToEBITDA")] - public double? NetDebtToEBITDA { get; set; } + public decimal? NetDebtToEBITDA { get; set; } [JsonPropertyName("currentRatio")] - public double? CurrentRatio { get; set; } + public decimal? CurrentRatio { get; set; } [JsonPropertyName("interestCoverage")] - public double? InterestCoverage { get; set; } + public decimal? InterestCoverage { get; set; } [JsonPropertyName("incomeQuality")] - public double? IncomeQuality { get; set; } + public decimal? IncomeQuality { get; set; } [JsonPropertyName("dividendYield")] - public double? DividendYield { get; set; } + public decimal? DividendYield { get; set; } [JsonPropertyName("payoutRatio")] - public double? PayoutRatio { get; set; } + public decimal? PayoutRatio { get; set; } [JsonPropertyName("salesGeneralAndAdministrativeToRevenue")] - public double? SalesGeneralAndAdministrativeToRevenue { get; set; } + public decimal? SalesGeneralAndAdministrativeToRevenue { get; set; } [JsonPropertyName("researchAndDdevelopementToRevenue")] - public double? ResearchAndDdevelopementToRevenue { get; set; } + public decimal? ResearchAndDdevelopementToRevenue { get; set; } [JsonPropertyName("intangiblesToTotalAssets")] - public double? IntangiblesToTotalAssets { get; set; } + public decimal? IntangiblesToTotalAssets { get; set; } [JsonPropertyName("capexToOperatingCashFlow")] - public double? CapexToOperatingCashFlow { get; set; } + public decimal? CapexToOperatingCashFlow { get; set; } [JsonPropertyName("capexToRevenue")] - public double? CapexToRevenue { get; set; } + public decimal? CapexToRevenue { get; set; } [JsonPropertyName("capexToDepreciation")] - public double? CapexToDepreciation { get; set; } + public decimal? CapexToDepreciation { get; set; } [JsonPropertyName("stockBasedCompensationToRevenue")] - public double? StockBasedCompensationToRevenue { get; set; } + public decimal? StockBasedCompensationToRevenue { get; set; } [JsonPropertyName("grahamNumber")] - public double? GrahamNumber { get; set; } + public decimal? GrahamNumber { get; set; } [JsonPropertyName("roic")] - public double? Roic { get; set; } + public decimal? Roic { get; set; } [JsonPropertyName("returnOnTangibleAssets")] - public double? ReturnOnTangibleAssets { get; set; } + public decimal? ReturnOnTangibleAssets { get; set; } [JsonPropertyName("grahamNetNet")] - public double? GrahamNetNet { get; set; } + public decimal? GrahamNetNet { get; set; } [JsonPropertyName("workingCapital")] - public double? WorkingCapital { get; set; } + public decimal? WorkingCapital { get; set; } [JsonPropertyName("tangibleAssetValue")] - public double? TangibleAssetValue { get; set; } + public decimal? TangibleAssetValue { get; set; } [JsonPropertyName("netCurrentAssetValue")] - public double? NetCurrentAssetValue { get; set; } + public decimal? NetCurrentAssetValue { get; set; } [JsonPropertyName("investedCapital")] - public double? InvestedCapital { get; set; } + public decimal? InvestedCapital { get; set; } [JsonPropertyName("averageReceivables")] - public double? AverageReceivables { get; set; } + public decimal? AverageReceivables { get; set; } [JsonPropertyName("averagePayables")] - public double? AveragePayables { get; set; } + public decimal? AveragePayables { get; set; } [JsonPropertyName("averageInventory")] - public double? AverageInventory { get; set; } + public decimal? AverageInventory { get; set; } [JsonPropertyName("daysSalesOutstanding")] - public double? DaysSalesOutstanding { get; set; } + public decimal? DaysSalesOutstanding { get; set; } [JsonPropertyName("daysPayablesOutstanding")] - public double? DaysPayablesOutstanding { get; set; } + public decimal? DaysPayablesOutstanding { get; set; } [JsonPropertyName("daysOfInventoryOnHand")] - public double? DaysOfInventoryOnHand { get; set; } + public decimal? DaysOfInventoryOnHand { get; set; } [JsonPropertyName("receivablesTurnover")] - public double? ReceivablesTurnover { get; set; } + public decimal? ReceivablesTurnover { get; set; } [JsonPropertyName("payablesTurnover")] - public double? PayablesTurnover { get; set; } + public decimal? PayablesTurnover { get; set; } [JsonPropertyName("inventoryTurnover")] - public double? InventoryTurnover { get; set; } + public decimal? InventoryTurnover { get; set; } [JsonPropertyName("roe")] - public double? Roe { get; set; } + public decimal? Roe { get; set; } [JsonPropertyName("capexPerShare")] - public double? CapexPerShare { get; set; } + public decimal? CapexPerShare { get; set; } } } diff --git a/FinancialModelingPrepApi/Model/CompanyValuation/KeyMetricsTTMResponse.cs b/FinancialModelingPrepApi/Model/CompanyValuation/KeyMetricsTTMResponse.cs index 7736503..a5c44f5 100644 --- a/FinancialModelingPrepApi/Model/CompanyValuation/KeyMetricsTTMResponse.cs +++ b/FinancialModelingPrepApi/Model/CompanyValuation/KeyMetricsTTMResponse.cs @@ -5,136 +5,136 @@ namespace MatthiWare.FinancialModelingPrep.Model.CompanyValuation public class KeyMetricsTTMResponse { [JsonPropertyName("revenuePerShareTTM")] - public double? RevenuePerShareTTM { get; set; } + public decimal? RevenuePerShareTTM { get; set; } [JsonPropertyName("netIncomePerShareTTM")] - public double? NetIncomePerShareTTM { get; set; } + public decimal? NetIncomePerShareTTM { get; set; } [JsonPropertyName("operatingCashFlowPerShareTTM")] - public double? OperatingCashFlowPerShareTTM { get; set; } + public decimal? OperatingCashFlowPerShareTTM { get; set; } [JsonPropertyName("freeCashFlowPerShareTTM")] - public double? FreeCashFlowPerShareTTM { get; set; } + public decimal? FreeCashFlowPerShareTTM { get; set; } [JsonPropertyName("cashPerShareTTM")] - public double? CashPerShareTTM { get; set; } + public decimal? CashPerShareTTM { get; set; } [JsonPropertyName("bookValuePerShareTTM")] - public double? BookValuePerShareTTM { get; set; } + public decimal? BookValuePerShareTTM { get; set; } [JsonPropertyName("tangibleBookValuePerShareTTM")] - public double? TangibleBookValuePerShareTTM { get; set; } + public decimal? TangibleBookValuePerShareTTM { get; set; } [JsonPropertyName("shareholdersEquityPerShareTTM")] - public double? ShareholdersEquityPerShareTTM { get; set; } + public decimal? ShareholdersEquityPerShareTTM { get; set; } [JsonPropertyName("interestDebtPerShareTTM")] - public double? InterestDebtPerShareTTM { get; set; } + public decimal? InterestDebtPerShareTTM { get; set; } [JsonPropertyName("marketCapTTM")] - public double? MarketCapTTM { get; set; } + public decimal? MarketCapTTM { get; set; } [JsonPropertyName("enterpriseValueTTM")] - public double? EnterpriseValueTTM { get; set; } + public decimal? EnterpriseValueTTM { get; set; } [JsonPropertyName("peRatioTTM")] - public double? PeRatioTTM { get; set; } + public decimal? PeRatioTTM { get; set; } [JsonPropertyName("priceToSalesRatioTTM")] - public double? PriceToSalesRatioTTM { get; set; } + public decimal? PriceToSalesRatioTTM { get; set; } [JsonPropertyName("pocfratioTTM")] - public double? PocfratioTTM { get; set; } + public decimal? PocfratioTTM { get; set; } [JsonPropertyName("pfcfRatioTTM")] - public double? PfcfRatioTTM { get; set; } + public decimal? PfcfRatioTTM { get; set; } [JsonPropertyName("pbRatioTTM")] - public double? PbRatioTTM { get; set; } + public decimal? PbRatioTTM { get; set; } [JsonPropertyName("ptbRatioTTM")] - public double? PtbRatioTTM { get; set; } + public decimal? PtbRatioTTM { get; set; } [JsonPropertyName("evToSalesTTM")] - public double? EvToSalesTTM { get; set; } + public decimal? EvToSalesTTM { get; set; } [JsonPropertyName("enterpriseValueOverEBITDATTM")] - public double? EnterpriseValueOverEBITDATTM { get; set; } + public decimal? EnterpriseValueOverEBITDATTM { get; set; } [JsonPropertyName("evToOperatingCashFlowTTM")] - public double? EvToOperatingCashFlowTTM { get; set; } + public decimal? EvToOperatingCashFlowTTM { get; set; } [JsonPropertyName("evToFreeCashFlowTTM")] - public double? EvToFreeCashFlowTTM { get; set; } + public decimal? EvToFreeCashFlowTTM { get; set; } [JsonPropertyName("earningsYieldTTM")] - public double? EarningsYieldTTM { get; set; } + public decimal? EarningsYieldTTM { get; set; } [JsonPropertyName("freeCashFlowYieldTTM")] - public double? FreeCashFlowYieldTTM { get; set; } + public decimal? FreeCashFlowYieldTTM { get; set; } [JsonPropertyName("debtToEquityTTM")] - public double? DebtToEquityTTM { get; set; } + public decimal? DebtToEquityTTM { get; set; } [JsonPropertyName("debtToAssetsTTM")] - public double? DebtToAssetsTTM { get; set; } + public decimal? DebtToAssetsTTM { get; set; } [JsonPropertyName("debtToMarketCapTTM")] - public double? DebtToMarketCapTTM { get; set; } + public decimal? DebtToMarketCapTTM { get; set; } [JsonPropertyName("netDebtToEBITDATTM")] - public double? NetDebtToEBITDATTM { get; set; } + public decimal? NetDebtToEBITDATTM { get; set; } [JsonPropertyName("currentRatioTTM")] - public double? CurrentRatioTTM { get; set; } + public decimal? CurrentRatioTTM { get; set; } [JsonPropertyName("interestCoverageTTM")] - public double? InterestCoverageTTM { get; set; } + public decimal? InterestCoverageTTM { get; set; } [JsonPropertyName("incomeQualityTTM")] - public double? IncomeQualityTTM { get; set; } + public decimal? IncomeQualityTTM { get; set; } [JsonPropertyName("dividendYieldTTM")] - public double? DividendYieldTTM { get; set; } + public decimal? DividendYieldTTM { get; set; } [JsonPropertyName("dividendYieldPercentageTTM")] - public double? DividendYieldPercentageTTM { get; set; } + public decimal? DividendYieldPercentageTTM { get; set; } [JsonPropertyName("payoutRatioTTM")] - public double? PayoutRatioTTM { get; set; } + public decimal? PayoutRatioTTM { get; set; } [JsonPropertyName("salesGeneralAndAdministrativeToRevenueTTM")] - public double? SalesGeneralAndAdministrativeToRevenueTTM { get; set; } + public decimal? SalesGeneralAndAdministrativeToRevenueTTM { get; set; } [JsonPropertyName("researchAndDevelopementToRevenueTTM")] - public double? ResearchAndDevelopementToRevenueTTM { get; set; } + public decimal? ResearchAndDevelopementToRevenueTTM { get; set; } [JsonPropertyName("intangiblesToTotalAssetsTTM")] - public double? IntangiblesToTotalAssetsTTM { get; set; } + public decimal? IntangiblesToTotalAssetsTTM { get; set; } [JsonPropertyName("capexToOperatingCashFlowTTM")] - public double? CapexToOperatingCashFlowTTM { get; set; } + public decimal? CapexToOperatingCashFlowTTM { get; set; } [JsonPropertyName("capexToRevenueTTM")] - public double? CapexToRevenueTTM { get; set; } + public decimal? CapexToRevenueTTM { get; set; } [JsonPropertyName("capexToDepreciationTTM")] - public double? CapexToDepreciationTTM { get; set; } + public decimal? CapexToDepreciationTTM { get; set; } [JsonPropertyName("stockBasedCompensationToRevenueTTM")] - public double? StockBasedCompensationToRevenueTTM { get; set; } + public decimal? StockBasedCompensationToRevenueTTM { get; set; } [JsonPropertyName("grahamNumberTTM")] - public double? GrahamNumberTTM { get; set; } + public decimal? GrahamNumberTTM { get; set; } [JsonPropertyName("roicTTM")] - public double? RoicTTM { get; set; } + public decimal? RoicTTM { get; set; } [JsonPropertyName("returnOnTangibleAssetsTTM")] - public double? ReturnOnTangibleAssetsTTM { get; set; } + public decimal? ReturnOnTangibleAssetsTTM { get; set; } [JsonPropertyName("grahamNetNetTTM")] - public double? GrahamNetNetTTM { get; set; } + public decimal? GrahamNetNetTTM { get; set; } [JsonPropertyName("workingCapitalTTM")] public long? WorkingCapitalTTM { get; set; } @@ -143,10 +143,10 @@ public class KeyMetricsTTMResponse public object TangibleAssetValueTTM { get; set; } [JsonPropertyName("netCurrentAssetValueTTM")] - public double? NetCurrentAssetValueTTM { get; set; } + public decimal? NetCurrentAssetValueTTM { get; set; } [JsonPropertyName("investedCapitalTTM")] - public double? InvestedCapitalTTM { get; set; } + public decimal? InvestedCapitalTTM { get; set; } [JsonPropertyName("averageReceivablesTTM")] public long? AverageReceivablesTTM { get; set; } @@ -158,30 +158,30 @@ public class KeyMetricsTTMResponse public long? AverageInventoryTTM { get; set; } [JsonPropertyName("daysSalesOutstandingTTM")] - public double? DaysSalesOutstandingTTM { get; set; } + public decimal? DaysSalesOutstandingTTM { get; set; } [JsonPropertyName("daysPayablesOutstandingTTM")] - public double? DaysPayablesOutstandingTTM { get; set; } + public decimal? DaysPayablesOutstandingTTM { get; set; } [JsonPropertyName("daysOfInventoryOnHandTTM")] - public double? DaysOfInventoryOnHandTTM { get; set; } + public decimal? DaysOfInventoryOnHandTTM { get; set; } [JsonPropertyName("receivablesTurnoverTTM")] - public double? ReceivablesTurnoverTTM { get; set; } + public decimal? ReceivablesTurnoverTTM { get; set; } [JsonPropertyName("payablesTurnoverTTM")] - public double? PayablesTurnoverTTM { get; set; } + public decimal? PayablesTurnoverTTM { get; set; } [JsonPropertyName("inventoryTurnoverTTM")] - public double? InventoryTurnoverTTM { get; set; } + public decimal? InventoryTurnoverTTM { get; set; } [JsonPropertyName("roeTTM")] - public double? RoeTTM { get; set; } + public decimal? RoeTTM { get; set; } [JsonPropertyName("capexPerShareTTM")] - public double? CapexPerShareTTM { get; set; } + public decimal? CapexPerShareTTM { get; set; } [JsonPropertyName("dividendPerShareTTM")] - public double? DividendPerShareTTM { get; set; } + public decimal? DividendPerShareTTM { get; set; } } } diff --git a/FinancialModelingPrepApi/Model/CompanyValuation/MarketCapResponse.cs b/FinancialModelingPrepApi/Model/CompanyValuation/MarketCapResponse.cs index b209dcd..d2bedd1 100644 --- a/FinancialModelingPrepApi/Model/CompanyValuation/MarketCapResponse.cs +++ b/FinancialModelingPrepApi/Model/CompanyValuation/MarketCapResponse.cs @@ -11,6 +11,6 @@ public class MarketCapResponse public string Date { get; set; } [JsonPropertyName("marketCap")] - public double MarketCap { get; set; } + public decimal MarketCap { get; set; } } } diff --git a/FinancialModelingPrepApi/Model/CompanyValuation/QuoteResponse.cs b/FinancialModelingPrepApi/Model/CompanyValuation/QuoteResponse.cs index cf9035a..8e38f6f 100644 --- a/FinancialModelingPrepApi/Model/CompanyValuation/QuoteResponse.cs +++ b/FinancialModelingPrepApi/Model/CompanyValuation/QuoteResponse.cs @@ -12,34 +12,34 @@ public class QuoteResponse public string Name { get; set; } [JsonPropertyName("price")] - public double? Price { get; set; } + public decimal? Price { get; set; } [JsonPropertyName("changesPercentage")] - public double? ChangesPercentage { get; set; } + public decimal? ChangesPercentage { get; set; } [JsonPropertyName("change")] - public double? Change { get; set; } + public decimal? Change { get; set; } [JsonPropertyName("dayLow")] - public double? DayLow { get; set; } + public decimal? DayLow { get; set; } [JsonPropertyName("dayHigh")] - public double? DayHigh { get; set; } + public decimal? DayHigh { get; set; } [JsonPropertyName("yearHigh")] - public double? YearHigh { get; set; } + public decimal? YearHigh { get; set; } [JsonPropertyName("yearLow")] - public double? YearLow { get; set; } + public decimal? YearLow { get; set; } [JsonPropertyName("marketCap")] - public double? MarketCap { get; set; } + public decimal? MarketCap { get; set; } [JsonPropertyName("priceAvg50")] - public double? PriceAvg50 { get; set; } + public decimal? PriceAvg50 { get; set; } [JsonPropertyName("priceAvg200")] - public double? PriceAvg200 { get; set; } + public decimal? PriceAvg200 { get; set; } [JsonPropertyName("volume")] public long? Volume { get; set; } @@ -51,16 +51,16 @@ public class QuoteResponse public string Exchange { get; set; } [JsonPropertyName("open")] - public double? Open { get; set; } + public decimal? Open { get; set; } [JsonPropertyName("previousClose")] - public double? PreviousClose { get; set; } + public decimal? PreviousClose { get; set; } [JsonPropertyName("eps")] - public double? Eps { get; set; } + public decimal? Eps { get; set; } [JsonPropertyName("pe")] - public double? Pe { get; set; } + public decimal? Pe { get; set; } [JsonPropertyName("earningsAnnouncement")] public string EarningsAnnouncement { get; set; } diff --git a/FinancialModelingPrepApi/Model/CompanyValuation/RatiosTTMResponse.cs b/FinancialModelingPrepApi/Model/CompanyValuation/RatiosTTMResponse.cs index cb92575..44ebb7e 100644 --- a/FinancialModelingPrepApi/Model/CompanyValuation/RatiosTTMResponse.cs +++ b/FinancialModelingPrepApi/Model/CompanyValuation/RatiosTTMResponse.cs @@ -5,177 +5,177 @@ namespace MatthiWare.FinancialModelingPrep.Model.CompanyValuation public class RatiosTTMResponse { [JsonPropertyName("dividendYielTTM")] - public double? DividendYielTTM { get; set; } + public decimal? DividendYielTTM { get; set; } [JsonPropertyName("dividendYielPercentageTTM")] - public double? DividendYielPercentageTTM { get; set; } + public decimal? DividendYielPercentageTTM { get; set; } [JsonPropertyName("peRatioTTM")] - public double? PeRatioTTM { get; set; } + public decimal? PeRatioTTM { get; set; } [JsonPropertyName("pegRatioTTM")] - public double? PegRatioTTM { get; set; } + public decimal? PegRatioTTM { get; set; } [JsonPropertyName("payoutRatioTTM")] - public double? PayoutRatioTTM { get; set; } + public decimal? PayoutRatioTTM { get; set; } [JsonPropertyName("currentRatioTTM")] - public double? CurrentRatioTTM { get; set; } + public decimal? CurrentRatioTTM { get; set; } [JsonPropertyName("quickRatioTTM")] - public double? QuickRatioTTM { get; set; } + public decimal? QuickRatioTTM { get; set; } [JsonPropertyName("cashRatioTTM")] - public double? CashRatioTTM { get; set; } + public decimal? CashRatioTTM { get; set; } [JsonPropertyName("daysOfSalesOutstandingTTM")] - public double? DaysOfSalesOutstandingTTM { get; set; } + public decimal? DaysOfSalesOutstandingTTM { get; set; } [JsonPropertyName("daysOfInventoryOutstandingTTM")] - public double? DaysOfInventoryOutstandingTTM { get; set; } + public decimal? DaysOfInventoryOutstandingTTM { get; set; } [JsonPropertyName("operatingCycleTTM")] - public double? OperatingCycleTTM { get; set; } + public decimal? OperatingCycleTTM { get; set; } [JsonPropertyName("daysOfPayablesOutstandingTTM")] - public double? DaysOfPayablesOutstandingTTM { get; set; } + public decimal? DaysOfPayablesOutstandingTTM { get; set; } [JsonPropertyName("cashConversionCycleTTM")] - public double? CashConversionCycleTTM { get; set; } + public decimal? CashConversionCycleTTM { get; set; } [JsonPropertyName("grossProfitMarginTTM")] - public double? GrossProfitMarginTTM { get; set; } + public decimal? GrossProfitMarginTTM { get; set; } [JsonPropertyName("operatingProfitMarginTTM")] - public double? OperatingProfitMarginTTM { get; set; } + public decimal? OperatingProfitMarginTTM { get; set; } [JsonPropertyName("pretaxProfitMarginTTM")] - public double? PretaxProfitMarginTTM { get; set; } + public decimal? PretaxProfitMarginTTM { get; set; } [JsonPropertyName("netProfitMarginTTM")] - public double? NetProfitMarginTTM { get; set; } + public decimal? NetProfitMarginTTM { get; set; } [JsonPropertyName("effectiveTaxRateTTM")] - public double? EffectiveTaxRateTTM { get; set; } + public decimal? EffectiveTaxRateTTM { get; set; } [JsonPropertyName("returnOnAssetsTTM")] - public double? ReturnOnAssetsTTM { get; set; } + public decimal? ReturnOnAssetsTTM { get; set; } [JsonPropertyName("returnOnEquityTTM")] - public double? ReturnOnEquityTTM { get; set; } + public decimal? ReturnOnEquityTTM { get; set; } [JsonPropertyName("returnOnCapitalEmployedTTM")] - public double? ReturnOnCapitalEmployedTTM { get; set; } + public decimal? ReturnOnCapitalEmployedTTM { get; set; } [JsonPropertyName("netIncomePerEBTTTM")] - public double? NetIncomePerEBTTTM { get; set; } + public decimal? NetIncomePerEBTTTM { get; set; } [JsonPropertyName("ebtPerEbitTTM")] - public double? EbtPerEbitTTM { get; set; } + public decimal? EbtPerEbitTTM { get; set; } [JsonPropertyName("ebitPerRevenueTTM")] - public double? EbitPerRevenueTTM { get; set; } + public decimal? EbitPerRevenueTTM { get; set; } [JsonPropertyName("debtRatioTTM")] - public double? DebtRatioTTM { get; set; } + public decimal? DebtRatioTTM { get; set; } [JsonPropertyName("debtEquityRatioTTM")] - public double? DebtEquityRatioTTM { get; set; } + public decimal? DebtEquityRatioTTM { get; set; } [JsonPropertyName("longTermDebtToCapitalizationTTM")] - public double? LongTermDebtToCapitalizationTTM { get; set; } + public decimal? LongTermDebtToCapitalizationTTM { get; set; } [JsonPropertyName("totalDebtToCapitalizationTTM")] - public double? TotalDebtToCapitalizationTTM { get; set; } + public decimal? TotalDebtToCapitalizationTTM { get; set; } [JsonPropertyName("interestCoverageTTM")] - public double? InterestCoverageTTM { get; set; } + public decimal? InterestCoverageTTM { get; set; } [JsonPropertyName("cashFlowToDebtRatioTTM")] - public double? CashFlowToDebtRatioTTM { get; set; } + public decimal? CashFlowToDebtRatioTTM { get; set; } [JsonPropertyName("companyEquityMultiplierTTM")] - public double? CompanyEquityMultiplierTTM { get; set; } + public decimal? CompanyEquityMultiplierTTM { get; set; } [JsonPropertyName("receivablesTurnoverTTM")] - public double? ReceivablesTurnoverTTM { get; set; } + public decimal? ReceivablesTurnoverTTM { get; set; } [JsonPropertyName("payablesTurnoverTTM")] - public double? PayablesTurnoverTTM { get; set; } + public decimal? PayablesTurnoverTTM { get; set; } [JsonPropertyName("inventoryTurnoverTTM")] - public double? InventoryTurnoverTTM { get; set; } + public decimal? InventoryTurnoverTTM { get; set; } [JsonPropertyName("fixedAssetTurnoverTTM")] - public double? FixedAssetTurnoverTTM { get; set; } + public decimal? FixedAssetTurnoverTTM { get; set; } [JsonPropertyName("assetTurnoverTTM")] - public double? AssetTurnoverTTM { get; set; } + public decimal? AssetTurnoverTTM { get; set; } [JsonPropertyName("operatingCashFlowPerShareTTM")] - public double? OperatingCashFlowPerShareTTM { get; set; } + public decimal? OperatingCashFlowPerShareTTM { get; set; } [JsonPropertyName("freeCashFlowPerShareTTM")] - public double? FreeCashFlowPerShareTTM { get; set; } + public decimal? FreeCashFlowPerShareTTM { get; set; } [JsonPropertyName("cashPerShareTTM")] - public double? CashPerShareTTM { get; set; } + public decimal? CashPerShareTTM { get; set; } [JsonPropertyName("operatingCashFlowSalesRatioTTM")] - public double? OperatingCashFlowSalesRatioTTM { get; set; } + public decimal? OperatingCashFlowSalesRatioTTM { get; set; } [JsonPropertyName("freeCashFlowOperatingCashFlowRatioTTM")] - public double? FreeCashFlowOperatingCashFlowRatioTTM { get; set; } + public decimal? FreeCashFlowOperatingCashFlowRatioTTM { get; set; } [JsonPropertyName("cashFlowCoverageRatiosTTM")] - public double? CashFlowCoverageRatiosTTM { get; set; } + public decimal? CashFlowCoverageRatiosTTM { get; set; } [JsonPropertyName("shortTermCoverageRatiosTTM")] - public double? ShortTermCoverageRatiosTTM { get; set; } + public decimal? ShortTermCoverageRatiosTTM { get; set; } [JsonPropertyName("capitalExpenditureCoverageRatioTTM")] - public double? CapitalExpenditureCoverageRatioTTM { get; set; } + public decimal? CapitalExpenditureCoverageRatioTTM { get; set; } [JsonPropertyName("dividendPaidAndCapexCoverageRatioTTM")] - public double? DividendPaidAndCapexCoverageRatioTTM { get; set; } + public decimal? DividendPaidAndCapexCoverageRatioTTM { get; set; } [JsonPropertyName("priceBookValueRatioTTM")] - public double? PriceBookValueRatioTTM { get; set; } + public decimal? PriceBookValueRatioTTM { get; set; } [JsonPropertyName("priceToBookRatioTTM")] - public double? PriceToBookRatioTTM { get; set; } + public decimal? PriceToBookRatioTTM { get; set; } [JsonPropertyName("priceToSalesRatioTTM")] - public double? PriceToSalesRatioTTM { get; set; } + public decimal? PriceToSalesRatioTTM { get; set; } [JsonPropertyName("priceEarningsRatioTTM")] - public double? PriceEarningsRatioTTM { get; set; } + public decimal? PriceEarningsRatioTTM { get; set; } [JsonPropertyName("priceToFreeCashFlowsRatioTTM")] - public double? PriceToFreeCashFlowsRatioTTM { get; set; } + public decimal? PriceToFreeCashFlowsRatioTTM { get; set; } [JsonPropertyName("priceToOperatingCashFlowsRatioTTM")] - public double? PriceToOperatingCashFlowsRatioTTM { get; set; } + public decimal? PriceToOperatingCashFlowsRatioTTM { get; set; } [JsonPropertyName("priceCashFlowRatioTTM")] - public double? PriceCashFlowRatioTTM { get; set; } + public decimal? PriceCashFlowRatioTTM { get; set; } [JsonPropertyName("priceEarningsToGrowthRatioTTM")] - public double? PriceEarningsToGrowthRatioTTM { get; set; } + public decimal? PriceEarningsToGrowthRatioTTM { get; set; } [JsonPropertyName("priceSalesRatioTTM")] - public double? PriceSalesRatioTTM { get; set; } + public decimal? PriceSalesRatioTTM { get; set; } [JsonPropertyName("dividendYieldTTM")] - public double? DividendYieldTTM { get; set; } + public decimal? DividendYieldTTM { get; set; } [JsonPropertyName("enterpriseValueMultipleTTM")] - public double? EnterpriseValueMultipleTTM { get; set; } + public decimal? EnterpriseValueMultipleTTM { get; set; } [JsonPropertyName("priceFairValueTTM")] - public double? PriceFairValueTTM { get; set; } + public decimal? PriceFairValueTTM { get; set; } [JsonPropertyName("dividendPerShareTTM")] - public double? DividendPerShareTTM { get; set; } + public decimal? DividendPerShareTTM { get; set; } } } diff --git a/FinancialModelingPrepApi/Model/CompanyValuation/SymbolResponse.cs b/FinancialModelingPrepApi/Model/CompanyValuation/SymbolResponse.cs index bc59b9b..95de3d1 100644 --- a/FinancialModelingPrepApi/Model/CompanyValuation/SymbolResponse.cs +++ b/FinancialModelingPrepApi/Model/CompanyValuation/SymbolResponse.cs @@ -11,7 +11,7 @@ public class SymbolResponse public string Name { get; set; } [JsonPropertyName("price")] - public double Price { get; set; } + public decimal Price { get; set; } [JsonPropertyName("exchange")] public string Exchange { get; set; } diff --git a/FinancialModelingPrepApi/Model/Crypto/CyptoHistoricalPriceListings.cs b/FinancialModelingPrepApi/Model/Crypto/CryptoHistoricalPriceListings.cs similarity index 72% rename from FinancialModelingPrepApi/Model/Crypto/CyptoHistoricalPriceListings.cs rename to FinancialModelingPrepApi/Model/Crypto/CryptoHistoricalPriceListings.cs index 6c4fa56..0cc882f 100644 --- a/FinancialModelingPrepApi/Model/Crypto/CyptoHistoricalPriceListings.cs +++ b/FinancialModelingPrepApi/Model/Crypto/CryptoHistoricalPriceListings.cs @@ -1,4 +1,5 @@ -using System; +using MatthiWare.FinancialModelingPrep.Abstractions.Model; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -28,40 +29,40 @@ public class CryptoHistoricalPricePeriodListing public long Volume { get; set; } } - public class CyptoHistoricalPriceDailyListing + public class CyptoHistoricalPriceDailyListing : IHistoricalQuote { [JsonPropertyName("date")] - public DateTime Date { get; set; } + public string Date { get; set; } [JsonPropertyName("open")] - public decimal Open { get; set; } + public double? Open { get; set; } [JsonPropertyName("high")] - public decimal High { get; set; } + public double? High { get; set; } [JsonPropertyName("low")] - public decimal Low { get; set; } + public double? Low { get; set; } [JsonPropertyName("close")] - public decimal Close { get; set; } + public double Close { get; set; } - [JsonPropertyName("adjClose")] - public decimal AdjClose { get; set; } + [JsonPropertyName("change")] + public double? Change { get; set; } + + [JsonPropertyName("changePercent")] + public double? ChangePercent { get; set; } [JsonPropertyName("volume")] public double Volume { get; set; } + [JsonPropertyName("adjClose")] + public double AdjClose { get; set; } + [JsonPropertyName("unadjustedVolume")] public double UnadjustedVolume { get; set; } - [JsonPropertyName("change")] - public decimal Change { get; set; } - - [JsonPropertyName("changePercent")] - public decimal ChangePercent { get; set; } - [JsonPropertyName("vwap")] - public decimal VWAP { get; set; } + public double VWAP { get; set; } [JsonPropertyName("label")] public string Label { get; set; } diff --git a/FinancialModelingPrepApi/Model/Crypto/CryptoHistoricalPricePeriodItem.cs b/FinancialModelingPrepApi/Model/Crypto/CryptoHistoricalPricePeriodItem.cs index 2783856..fc83e0c 100644 --- a/FinancialModelingPrepApi/Model/Crypto/CryptoHistoricalPricePeriodItem.cs +++ b/FinancialModelingPrepApi/Model/Crypto/CryptoHistoricalPricePeriodItem.cs @@ -13,6 +13,6 @@ public class CryptoHistoricalPriceDailyItem public string Symbol { get; set; } [JsonPropertyName("historical")] - public List HistoricalPrices { get; set; } + public List Historical { get; set; } } } diff --git a/FinancialModelingPrepApi/Model/Crypto/CryptoQuoteResponse.cs b/FinancialModelingPrepApi/Model/Crypto/CryptoQuoteResponse.cs new file mode 100644 index 0000000..bf9be1a --- /dev/null +++ b/FinancialModelingPrepApi/Model/Crypto/CryptoQuoteResponse.cs @@ -0,0 +1,76 @@ +using MatthiWare.FinancialModelingPrep.Abstractions.Model; +using System; +using System.Text.Json.Serialization; + +namespace MatthiWare.FinancialModelingPrep.Model.Crypto +{ + public class CryptoQuoteResponse : ICurrentQuote + { + // Crypto + [JsonPropertyName("symbol")] + public string Symbol { get; set; } + + [JsonPropertyName("name")] + public string Name { get; set; } + + [JsonPropertyName("exchange")] + public string Exchange { get; set; } + + [JsonPropertyName("open")] + public double? Open { get; set; } + + [JsonPropertyName("price")] + public double? Price { get; set; } + + [JsonPropertyName("previousclose")] + public double? PreviousClose { get; set; } + + [JsonPropertyName("daylow")] + public double? DayLow { get; set; } + + [JsonPropertyName("dayhigh")] + public double? DayHigh { get; set; } + + [JsonPropertyName("yearlow")] + public double? YearlyLow { get; set; } + + [JsonPropertyName("yearhigh")] + public double? YearlyHigh { get; set; } + + [JsonPropertyName("priceavg50")] + public double? PriceAvg50 { get; set; } + + [JsonPropertyName("priceavg200")] + public double? PriceAvg200 { get; set; } + + [JsonPropertyName("change")] + public double? Change { get; set; } + + [JsonPropertyName("changespercentage")] + public double? ChangesPercentage { get; set; } + + [JsonPropertyName("timestamp")] + public long? Timestamp { get; set; } + [JsonPropertyName("volume")] + public double? Volume { get; set; } + [JsonPropertyName("avgVolume")] + public double? AvgVolume { get; set; } + + // Not used by Forex or Futures. + + [JsonPropertyName("eps")] + public double? Eps { get; set; } + + [JsonPropertyName("pe")] + public double? Pe { get; set; } + + [JsonPropertyName("earningsAnnouncement")] + public string? EarningsAnnouncement { get; set; } + + [JsonPropertyName("sharesOutstanding")] + public double? SharesOutstanding { get; set; } + + [JsonPropertyName("marketCap")] + public double? MarketCap { get; set; } + } +} diff --git a/FinancialModelingPrepApi/Model/Forex/ForexBookResponse.cs b/FinancialModelingPrepApi/Model/Forex/ForexBookResponse.cs new file mode 100644 index 0000000..fe63246 --- /dev/null +++ b/FinancialModelingPrepApi/Model/Forex/ForexBookResponse.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json.Serialization; +using System.Threading.Tasks; + +namespace MatthiWare.FinancialModelingPrep.Model.Forex +{ + public class ForexBookResponse + { + [JsonPropertyName("ticker")] + public string Ticker { get; set; } + + [JsonPropertyName("bid")] + public decimal Bid { get; set; } + + [JsonPropertyName("open")] + public decimal Open { get; set; } + + [JsonPropertyName("low")] + public decimal Low { get; set; } + + [JsonPropertyName("high")] + public decimal High { get; set; } + + [JsonPropertyName("changes")] + public decimal Changes { get; set; } + + [JsonPropertyName("date")] + public DateTime Date { get; set; } + } +} diff --git a/FinancialModelingPrepApi/Model/Forex/ForexHistoricalQuoteResponse.cs b/FinancialModelingPrepApi/Model/Forex/ForexHistoricalQuoteResponse.cs new file mode 100644 index 0000000..93410b4 --- /dev/null +++ b/FinancialModelingPrepApi/Model/Forex/ForexHistoricalQuoteResponse.cs @@ -0,0 +1,32 @@ +using MatthiWare.FinancialModelingPrep.Abstractions.Model; +using System; +using System.Text.Json.Serialization; + +namespace MatthiWare.FinancialModelingPrep.Model.Forex +{ + public class ForexHistoricalQuoteResponse : IHistoricalQuote + { + [JsonPropertyName("date")] + public string Date { get; set; } + + [JsonPropertyName("open")] + public double? Open { get; set; } + + [JsonPropertyName("high")] + public double? High { get; set; } + + [JsonPropertyName("low")] + public double? Low { get; set; } + + [JsonPropertyName("close")] + public double Close { get; set; } + + [JsonPropertyName("change")] + public double? Change { get; set; } + [JsonPropertyName("volume")] + public double Volume { get; set; } + + [JsonPropertyName("changePercent")] + public double? ChangePercent { get; set; } + } +} diff --git a/FinancialModelingPrepApi/Model/Forex/ForexQuoteResponse.cs b/FinancialModelingPrepApi/Model/Forex/ForexQuoteResponse.cs new file mode 100644 index 0000000..5347d7c --- /dev/null +++ b/FinancialModelingPrepApi/Model/Forex/ForexQuoteResponse.cs @@ -0,0 +1,76 @@ +using MatthiWare.FinancialModelingPrep.Abstractions.Model; +using System; +using System.Text.Json.Serialization; + +namespace MatthiWare.FinancialModelingPrep.Model.Forex +{ + public class ForexQuoteResponse : ICurrentQuote + { + // FX + [JsonPropertyName("symbol")] + public string Symbol { get; set; } + + [JsonPropertyName("name")] + public string Name { get; set; } + + [JsonPropertyName("exchange")] + public string Exchange { get; set; } + + [JsonPropertyName("open")] + public double? Open { get; set; } + + [JsonPropertyName("price")] + public double? Price { get; set; } + + [JsonPropertyName("previousclose")] + public double? PreviousClose { get; set; } + + [JsonPropertyName("daylow")] + public double? DayLow { get; set; } + + [JsonPropertyName("dayhigh")] + public double? DayHigh { get; set; } + + [JsonPropertyName("yearlow")] + public double? YearlyLow { get; set; } + + [JsonPropertyName("yearhigh")] + public double? YearlyHigh { get; set; } + + [JsonPropertyName("priceavg50")] + public double? PriceAvg50 { get; set; } + + [JsonPropertyName("priceavg200")] + public double? PriceAvg200 { get; set; } + + [JsonPropertyName("change")] + public double? Change { get; set; } + + [JsonPropertyName("changespercentage")] + public double? ChangesPercentage { get; set; } + + [JsonPropertyName("timestamp")] + public long? Timestamp { get; set; } + [JsonPropertyName("volume")] + public double? Volume { get; set; } + [JsonPropertyName("avgVolume")] + public double? AvgVolume { get; set; } + + // Not used by Forex or Futures. + + [JsonPropertyName("eps")] + public double? Eps { get; set; } + + [JsonPropertyName("pe")] + public double? Pe { get; set; } + + [JsonPropertyName("earningsAnnouncement")] + public string? EarningsAnnouncement { get; set; } + + [JsonPropertyName("sharesOutstanding")] + public double? SharesOutstanding { get; set; } + + [JsonPropertyName("marketCap")] + public double? MarketCap { get; set; } + } +} diff --git a/FinancialModelingPrepApi/Model/Fund/ETFStockExposureResponse.cs b/FinancialModelingPrepApi/Model/Fund/ETFStockExposureResponse.cs index 2bb656e..a8b12f1 100644 --- a/FinancialModelingPrepApi/Model/Fund/ETFStockExposureResponse.cs +++ b/FinancialModelingPrepApi/Model/Fund/ETFStockExposureResponse.cs @@ -14,9 +14,9 @@ public class ETFStockExposureResponse public int SharesNumber { get; set; } [JsonPropertyName("weightPercentage")] - public double WeightPercentage { get; set; } + public decimal WeightPercentage { get; set; } [JsonPropertyName("marketValue")] - public double MarketValue { get; set; } + public decimal MarketValue { get; set; } } } diff --git a/FinancialModelingPrepApi/Model/Futures/FuturesHistoricalQuoteResponse.cs b/FinancialModelingPrepApi/Model/Futures/FuturesHistoricalQuoteResponse.cs new file mode 100644 index 0000000..ef9554a --- /dev/null +++ b/FinancialModelingPrepApi/Model/Futures/FuturesHistoricalQuoteResponse.cs @@ -0,0 +1,32 @@ +using MatthiWare.FinancialModelingPrep.Abstractions.Model; +using System; +using System.Text.Json.Serialization; + +namespace MatthiWare.FinancialModelingPrep.Model.Futures +{ + public class FuturesHistoricalQuoteResponse : IHistoricalQuote + { + [JsonPropertyName("date")] + public string Date { get; set; } + + [JsonPropertyName("open")] + public double? Open { get; set; } + + [JsonPropertyName("high")] + public double? High { get; set; } + + [JsonPropertyName("low")] + public double? Low { get; set; } + + [JsonPropertyName("close")] + public double Close { get; set; } + + [JsonPropertyName("change")] + public double? Change { get; set; } + + [JsonPropertyName("changePercent")] + public double? ChangePercent { get; set; } + [JsonPropertyName("volume")] + public double Volume { get; set; } + } +} diff --git a/FinancialModelingPrepApi/Model/Futures/FuturesQuoteResponse.cs b/FinancialModelingPrepApi/Model/Futures/FuturesQuoteResponse.cs new file mode 100644 index 0000000..d429148 --- /dev/null +++ b/FinancialModelingPrepApi/Model/Futures/FuturesQuoteResponse.cs @@ -0,0 +1,76 @@ +using MatthiWare.FinancialModelingPrep.Abstractions.Model; +using System; +using System.Text.Json.Serialization; + +namespace MatthiWare.FinancialModelingPrep.Model.Futures +{ + public class FuturesQuoteResponse : ICurrentQuote + { + // Futures + [JsonPropertyName("symbol")] + public string Symbol { get; set; } + + [JsonPropertyName("name")] + public string Name { get; set; } + + [JsonPropertyName("exchange")] + public string Exchange { get; set; } + + [JsonPropertyName("open")] + public double? Open { get; set; } + + [JsonPropertyName("price")] + public double? Price { get; set; } + + [JsonPropertyName("previousclose")] + public double? PreviousClose { get; set; } + + [JsonPropertyName("daylow")] + public double? DayLow { get; set; } + + [JsonPropertyName("dayhigh")] + public double? DayHigh { get; set; } + + [JsonPropertyName("yearlow")] + public double? YearlyLow { get; set; } + + [JsonPropertyName("yearhigh")] + public double? YearlyHigh { get; set; } + + [JsonPropertyName("priceavg50")] + public double? PriceAvg50 { get; set; } + + [JsonPropertyName("priceavg200")] + public double? PriceAvg200 { get; set; } + + [JsonPropertyName("change")] + public double? Change { get; set; } + + [JsonPropertyName("changespercentage")] + public double? ChangesPercentage { get; set; } + + [JsonPropertyName("timestamp")] + public long? Timestamp { get; set; } + + [JsonPropertyName("volume")] + public double? Volume { get; set; } + [JsonPropertyName("avgVolume")] + public double? AvgVolume { get; set; } + // Not used by Forex or Futures. + + [JsonPropertyName("eps")] + public double? Eps { get; set; } + + [JsonPropertyName("pe")] + public double? Pe { get; set; } + + [JsonPropertyName("earningsAnnouncement")] + public string? EarningsAnnouncement { get; set; } + + [JsonPropertyName("sharesOutstanding")] + public double? SharesOutstanding { get; set; } + + [JsonPropertyName("marketCap")] + public double? MarketCap { get; set; } + } +} diff --git a/FinancialModelingPrepApi/Model/Period.cs b/FinancialModelingPrepApi/Model/Period.cs index 8c2a1e2..d64bb13 100644 --- a/FinancialModelingPrepApi/Model/Period.cs +++ b/FinancialModelingPrepApi/Model/Period.cs @@ -13,6 +13,9 @@ public enum HistoricalPricingPeriod FifteenMinute, ThirtyMinute, OneHour, - FourHour + FourHour, + Day, + Week, + Month } } diff --git a/FinancialModelingPrepApi/Model/Statistics/AnalystEstimateItem.cs b/FinancialModelingPrepApi/Model/Statistics/AnalystEstimateItem.cs index 77b0ff5..3778ed8 100644 --- a/FinancialModelingPrepApi/Model/Statistics/AnalystEstimateItem.cs +++ b/FinancialModelingPrepApi/Model/Statistics/AnalystEstimateItem.cs @@ -11,58 +11,58 @@ public class AnalystEstimateItem public string Date { get; set; } [JsonPropertyName("estimatedRevenueLow")] - public double EstimatedRevenueLow { get; set; } + public decimal EstimatedRevenueLow { get; set; } [JsonPropertyName("estimatedRevenueHigh")] - public double EstimatedRevenueHigh { get; set; } + public decimal EstimatedRevenueHigh { get; set; } [JsonPropertyName("estimatedRevenueAvg")] - public double EstimatedRevenueAvg { get; set; } + public decimal EstimatedRevenueAvg { get; set; } [JsonPropertyName("estimatedEbitdaLow")] - public double EstimatedEbitdaLow { get; set; } + public decimal EstimatedEbitdaLow { get; set; } [JsonPropertyName("estimatedEbitdaHigh")] - public double EstimatedEbitdaHigh { get; set; } + public decimal EstimatedEbitdaHigh { get; set; } [JsonPropertyName("estimatedEbitdaAvg")] - public double EstimatedEbitdaAvg { get; set; } + public decimal EstimatedEbitdaAvg { get; set; } [JsonPropertyName("estimatedEbitLow")] - public double EstimatedEbitLow { get; set; } + public decimal EstimatedEbitLow { get; set; } [JsonPropertyName("estimatedEbitHigh")] - public double EstimatedEbitHigh { get; set; } + public decimal EstimatedEbitHigh { get; set; } [JsonPropertyName("estimatedEbitAvg")] - public double EstimatedEbitAvg { get; set; } + public decimal EstimatedEbitAvg { get; set; } [JsonPropertyName("estimatedNetIncomeLow")] - public double EstimatedNetIncomeLow { get; set; } + public decimal EstimatedNetIncomeLow { get; set; } [JsonPropertyName("estimatedNetIncomeHigh")] - public double EstimatedNetIncomeHigh { get; set; } + public decimal EstimatedNetIncomeHigh { get; set; } [JsonPropertyName("estimatedNetIncomeAvg")] - public double EstimatedNetIncomeAvg { get; set; } + public decimal EstimatedNetIncomeAvg { get; set; } [JsonPropertyName("estimatedSgaExpenseLow")] - public double EstimatedSgaExpenseLow { get; set; } + public decimal EstimatedSgaExpenseLow { get; set; } [JsonPropertyName("estimatedSgaExpenseHigh")] - public double EstimatedSgaExpenseHigh { get; set; } + public decimal EstimatedSgaExpenseHigh { get; set; } [JsonPropertyName("estimatedSgaExpenseAvg")] - public double EstimatedSgaExpenseAvg { get; set; } + public decimal EstimatedSgaExpenseAvg { get; set; } [JsonPropertyName("estimatedEpsAvg")] - public double EstimatedEpsAvg { get; set; } + public decimal EstimatedEpsAvg { get; set; } [JsonPropertyName("estimatedEpsHigh")] - public double EstimatedEpsHigh { get; set; } + public decimal EstimatedEpsHigh { get; set; } [JsonPropertyName("estimatedEpsLow")] - public double EstimatedEpsLow { get; set; } + public decimal EstimatedEpsLow { get; set; } [JsonPropertyName("numberAnalystEstimatedRevenue")] public int NumberAnalystEstimatedRevenue { get; set; } diff --git a/FinancialModelingPrepApi/Model/StockMarket/StockHistoricalDividendResponse.cs b/FinancialModelingPrepApi/Model/StockMarket/StockHistoricalDividendResponse.cs new file mode 100644 index 0000000..d4888f5 --- /dev/null +++ b/FinancialModelingPrepApi/Model/StockMarket/StockHistoricalDividendResponse.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json.Serialization; +using System.Threading.Tasks; + +namespace MatthiWare.FinancialModelingPrep.Model.StockMarket +{ + public class StockDividendResponse + { + [JsonPropertyName("symbol")] + public string Symbol { get; set; } + + [JsonPropertyName("historical")] + public List HistoricalDividends { get; set; } + } + + public class StockHistoricalDividendResponse + { + [JsonPropertyName("date")] + public string Date { get; set; } + [JsonPropertyName("label")] + public string Label { get; set; } + [JsonPropertyName("adjDividend")] + public string AdjDividend { get; set; } + [JsonPropertyName("dividend")] + public string Dividend { get; set; } + [JsonPropertyName("recordDate")] + public string RecordDate { get; set; } + [JsonPropertyName("paymentDate")] + public string PaymentDate { get; set; } + [JsonPropertyName("declarationDate")] + public string DeclarationDate { get; set; } + } +} diff --git a/FinancialModelingPrepApi/Model/StockMarket/StockMarketSymbolResponse.cs b/FinancialModelingPrepApi/Model/StockMarket/StockMarketSymbolResponse.cs index 58ce5cf..c9ffb04 100644 --- a/FinancialModelingPrepApi/Model/StockMarket/StockMarketSymbolResponse.cs +++ b/FinancialModelingPrepApi/Model/StockMarket/StockMarketSymbolResponse.cs @@ -8,7 +8,7 @@ public class StockMarketSymbolResponse public string Ticker { get; set; } [JsonPropertyName("changes")] - public double Changes { get; set; } + public decimal Changes { get; set; } [JsonPropertyName("price")] public string Price { get; set; } diff --git a/FinancialModelingPrepApi/Model/StockMarket/StockQuoteResponse.cs b/FinancialModelingPrepApi/Model/StockMarket/StockQuoteResponse.cs new file mode 100644 index 0000000..bfd363f --- /dev/null +++ b/FinancialModelingPrepApi/Model/StockMarket/StockQuoteResponse.cs @@ -0,0 +1,75 @@ +using MatthiWare.FinancialModelingPrep.Abstractions.Model; +using System.Text.Json.Serialization; + +namespace MatthiWare.FinancialModelingPrep.Model.StockMarket +{ + public class StockQuoteResponse : ICurrentQuote + { + // Stock + [JsonPropertyName("symbol")] + public string Symbol { get; set; } + + [JsonPropertyName("name")] + public string Name { get; set; } + + [JsonPropertyName("exchange")] + public string Exchange { get; set; } + + [JsonPropertyName("open")] + public double? Open { get; set; } + + [JsonPropertyName("price")] + public double? Price { get; set; } + + [JsonPropertyName("previousClose")] + public double? PreviousClose { get; set; } + + [JsonPropertyName("dayLow")] + public double? DayLow { get; set; } + + [JsonPropertyName("dayHigh")] + public double? DayHigh { get; set; } + + [JsonPropertyName("yearLow")] + public double? YearlyLow { get; set; } + + [JsonPropertyName("yearHigh")] + public double? YearlyHigh { get; set; } + + [JsonPropertyName("priceAvg50")] + public double? PriceAvg50 { get; set; } + + [JsonPropertyName("priceAvg200")] + public double? PriceAvg200 { get; set; } + + [JsonPropertyName("change")] + public double? Change { get; set; } + + [JsonPropertyName("changesPercentage")] + public double? ChangesPercentage { get; set; } + + [JsonPropertyName("timestamp")] + public long? Timestamp { get; set; } + [JsonPropertyName("volume")] + public double? Volume { get; set; } + [JsonPropertyName("avgVolume")] + public double? AvgVolume { get; set; } + + // Not used by Forex or Futures. + + [JsonPropertyName("eps")] + public double? Eps { get; set; } + + [JsonPropertyName("pe")] + public double? Pe { get; set; } + + [JsonPropertyName("earningsAnnouncement")] + public string? EarningsAnnouncement { get; set; } + + [JsonPropertyName("sharesOutstanding")] + public double? SharesOutstanding { get; set; } + + [JsonPropertyName("marketCap")] + public double? MarketCap { get; set; } + } +} diff --git a/FinancialModelingPrepApi/Model/StockMarket/StockSP500ConstituentResponse.cs b/FinancialModelingPrepApi/Model/StockMarket/StockSP500ConstituentResponse.cs new file mode 100644 index 0000000..f16a17e --- /dev/null +++ b/FinancialModelingPrepApi/Model/StockMarket/StockSP500ConstituentResponse.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json.Serialization; +using System.Threading.Tasks; + +namespace MatthiWare.FinancialModelingPrep.Model.StockMarket +{ + public class IndexConstituentResponse + { + [JsonPropertyName("symbol")] + public string Symbol { get; set; } + + [JsonPropertyName("name")] + public string Name { get; set; } + [JsonPropertyName("sector")] + public string Sector { get; set; } + [JsonPropertyName("subSector")] + public string Subsector { get; set; } + [JsonPropertyName("headQuarter")] + public string Headquarter { get; set; } + [JsonPropertyName("dateFirstAdded")] + public string DateFirstAdded { get; set; } + [JsonPropertyName("cik")] + public string Cik { get; set; } + [JsonPropertyName("founded")] + public string Founded { get; set; } + } +} diff --git a/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalDividendItem.cs b/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalDividendItem.cs index b674522..97bff9f 100644 --- a/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalDividendItem.cs +++ b/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalDividendItem.cs @@ -11,10 +11,10 @@ public class HistoricalDividendItem public string Label { get; set; } [JsonPropertyName("adjDividend")] - public double AdjDividend { get; set; } + public decimal AdjDividend { get; set; } [JsonPropertyName("dividend")] - public double Dividend { get; set; } + public decimal Dividend { get; set; } [JsonPropertyName("recordDate")] public string RecordDate { get; set; } diff --git a/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalPriceForChartWithVolumeResponse.cs b/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalPriceForChartWithVolumeResponse.cs index 1079851..67b213d 100644 --- a/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalPriceForChartWithVolumeResponse.cs +++ b/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalPriceForChartWithVolumeResponse.cs @@ -1,25 +1,47 @@ -using System.Text.Json.Serialization; +using MatthiWare.FinancialModelingPrep.Abstractions.Model; +using System.Text.Json.Serialization; namespace MatthiWare.FinancialModelingPrep.Model.StockTimeSeries { - public class HistoricalPriceForChartWithVolumeResponse + public class HistoricalPriceForChartWithVolumeResponse : IHistoricalQuote { [JsonPropertyName("date")] public string Date { get; set; } [JsonPropertyName("open")] - public double Open { get; set; } - - [JsonPropertyName("low")] - public double Low { get; set; } + public double? Open { get; set; } [JsonPropertyName("high")] - public double High { get; set; } + public double? High { get; set; } + + [JsonPropertyName("low")] + public double? Low { get; set; } [JsonPropertyName("close")] public double Close { get; set; } + [JsonPropertyName("change")] + public double? Change { get; set; } + + [JsonPropertyName("changePercent")] + public double? ChangePercent { get; set; } + [JsonPropertyName("volume")] - public int Volume { get; set; } + public double Volume { get; set; } + + [JsonPropertyName("adjClose")] + public double AdjClose { get; set; } + + [JsonPropertyName("unadjustedVolume")] + public double UnadjustedVolume { get; set; } + + [JsonPropertyName("vwap")] + public double VWAP { get; set; } + + [JsonPropertyName("label")] + public string Label { get; set; } + + [JsonPropertyName("changeOvertime")] + public double ChangeOvertime { get; set; } } } diff --git a/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalPriceForLineChartResponse.cs b/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalPriceForLineChartResponse.cs index d3ffc26..083425a 100644 --- a/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalPriceForLineChartResponse.cs +++ b/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalPriceForLineChartResponse.cs @@ -18,6 +18,6 @@ public class HistoricalPriceForLineChartItem public string Date { get; set; } [JsonPropertyName("close")] - public double Close { get; set; } + public decimal Close { get; set; } } } diff --git a/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalPriceResponse.cs b/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalPriceResponse.cs index 21ee31f..b7060c1 100644 --- a/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalPriceResponse.cs +++ b/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalPriceResponse.cs @@ -1,4 +1,6 @@ -using System.Collections.Generic; +using MatthiWare.FinancialModelingPrep.Abstractions.Model; +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; namespace MatthiWare.FinancialModelingPrep.Model.StockTimeSeries @@ -12,19 +14,19 @@ public class HistoricalPriceResponse public List Historical { get; set; } } - public class HistoricalPriceItem + public class HistoricalPriceItem : IHistoricalQuote { [JsonPropertyName("date")] public string Date { get; set; } [JsonPropertyName("open")] - public double Open { get; set; } + public double? Open { get; set; } [JsonPropertyName("high")] - public double High { get; set; } + public double? High { get; set; } [JsonPropertyName("low")] - public double Low { get; set; } + public double? Low { get; set; } [JsonPropertyName("close")] public double Close { get; set; } @@ -39,13 +41,13 @@ public class HistoricalPriceItem public double UnadjustedVolume { get; set; } [JsonPropertyName("change")] - public double Change { get; set; } + public double? Change { get; set; } [JsonPropertyName("changePercent")] - public double ChangePercent { get; set; } + public double? ChangePercent { get; set; } [JsonPropertyName("vwap")] - public double Vwap { get; set; } + public double? Vwap { get; set; } [JsonPropertyName("label")] public string Label { get; set; } diff --git a/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalStockSplitItem.cs b/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalStockSplitItem.cs index 94eea24..21a56a6 100644 --- a/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalStockSplitItem.cs +++ b/FinancialModelingPrepApi/Model/StockTimeSeries/HistoricalStockSplitItem.cs @@ -11,9 +11,9 @@ public class HistoricalStockSplitItem public string Label { get; set; } [JsonPropertyName("numerator")] - public double Numerator { get; set; } + public decimal Numerator { get; set; } [JsonPropertyName("denominator")] - public double Denominator { get; set; } + public decimal Denominator { get; set; } } } diff --git a/README.md b/README.md index c1df384..64ea65d 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ -# FinancialModelingPrep.NET +# FinancialModelingPrep.NET Extended +.NET 8 API Client For https://financialmodelingprep.com/ API written in C#. Extended edition based on MatthiWare's foundation -- see repo this is forked off of. -[![.NET](https://github.com/MatthiWare/FinancialModelingPrep.NET/actions/workflows/dotnet.yml/badge.svg)](https://github.com/MatthiWare/FinancialModelingPrep.NET/actions/workflows/dotnet.yml) -[![Nuget](https://buildstats.info/nuget/MatthiWare.FinancialModelingPrep)](https://www.nuget.org/packages/MatthiWare.FinancialModelingPrep/) - -.NET 5 API Client For https://financialmodelingprep.com/ API written in C# +Actively maintained as part of a financial analysis project. ## Installation ```powershell -PM> Install-Package MatthiWare.FinancialModelingPrep +PM> Install-Package 1130Labs.FinancialModelingPrepExtended ``` # Quick Start @@ -103,8 +101,8 @@ else - Euronext - TSX - Stock Market (Partially covered) -- Cryptocurrencies (Not yet covered) -- Forex (Not yet covered) +- Cryptocurrencies +- Forex ### Contribute Create a PR where you add or improve an Endpoint diff --git a/Tests/AdvancedData/AdvancedDataTests.cs b/Tests/AdvancedData/AdvancedDataTests.cs index 1bba551..1aa0ed0 100644 --- a/Tests/AdvancedData/AdvancedDataTests.cs +++ b/Tests/AdvancedData/AdvancedDataTests.cs @@ -3,6 +3,7 @@ using MatthiWare.FinancialModelingPrep.Model; using MatthiWare.FinancialModelingPrep.Model.AdvancedData; using Microsoft.Extensions.DependencyInjection; +using System.Linq; using System.Threading.Tasks; using Xunit; using Xunit.Abstractions; @@ -17,6 +18,7 @@ public CompanyValuationTests(ITestOutputHelper testOutput) : base(testOutput) { api = ServiceProvider.GetRequiredService(); } + [Fact] public async Task GetFinancialReportAnnualAsync() @@ -28,6 +30,15 @@ public async Task GetFinancialReportAnnualAsync() Assert.Contains("AAPL", result.Data); } + [Fact] + public async Task GetFinancialScoreAsync() + { + var result = await api.GetFinancialScoreAsync("AAPL"); + + result.AssertNoErrors(); + Assert.Equal("AAPL", result.Data[0].Symbol); + } + [Fact] public async Task GetFinancialReportQuarterAsync() { @@ -111,5 +122,15 @@ private Task> GetStandardI _ => null, }; } + + [Fact] + public async Task CommitmentOfTradersReportTest() + { + var result = await api.GetCommitmentOfTradersReportAsync("ES"); + + result.AssertNoErrors(); + Assert.NotEmpty(result.Data); + Assert.Equal("AAPL", result.Data.First().Symbol); + } } } diff --git a/Tests/Calendars/CalendarsTests.cs b/Tests/Calendars/CalendarsTests.cs index 075a3b3..330cc03 100644 --- a/Tests/Calendars/CalendarsTests.cs +++ b/Tests/Calendars/CalendarsTests.cs @@ -102,8 +102,8 @@ public async Task GetDividendCalendarAsync() var firstResult = result.Data.First(_ => _.Symbol == "BRO"); Assert.Equal("BRO", firstResult.Symbol); - Assert.Equal(0.0925, firstResult.Dividend.Value, 4); - Assert.Equal(0.0925, firstResult.AdjDividend, 4); + Assert.Equal(0.0925m, firstResult.Dividend.Value, 4); + Assert.Equal(0.0925m, firstResult.AdjDividend, 4); Assert.Equal("2020-11-04", firstResult.RecordDate); Assert.Equal("2020-11-18", firstResult.PaymentDate); Assert.Equal("2020-10-20", firstResult.DeclarationDate); @@ -131,7 +131,7 @@ public async Task GetEconomicCalendarAsync() Assert.Equal(85, firstResult.Actual); Assert.Equal(83, firstResult.Previous); Assert.Equal(2, firstResult.Change); - Assert.Equal(0.0241, firstResult.ChangePercentage); + Assert.Equal(0.0241m, firstResult.ChangePercentage); Assert.Equal(83, firstResult.Estimate); } diff --git a/Tests/Crypto/CryptoMarketTests.cs b/Tests/Crypto/CryptoMarketTests.cs index 070cec8..1cbb3d9 100644 --- a/Tests/Crypto/CryptoMarketTests.cs +++ b/Tests/Crypto/CryptoMarketTests.cs @@ -1,4 +1,4 @@ -using MatthiWare.FinancialModelingPrep.Abstractions.StockMarket; +using MatthiWare.FinancialModelingPrep.Abstractions.Crypto; using Microsoft.Extensions.DependencyInjection; using System.Threading.Tasks; using Xunit; @@ -15,10 +15,20 @@ public CryptoMarketTests(ITestOutputHelper testOutput) : base(testOutput) api = ServiceProvider.GetRequiredService(); } + [Fact] + public async Task GetCryptocurrencyRealtime() + { + var result = await api.GetQuoteAsync("BTCUSD"); + + result.AssertNoErrors(); + Assert.NotNull(result.Data); + Assert.Equal("BTCUSD", result.Data[0].Symbol); + } + [Fact] public async Task GetAvailableCryptocurrencies() { - var result = await api.GetAvilableCryptocurrencies(); + var result = await api.GetAvilableCryptocurrenciesAsync(); result.AssertNoErrors(); Assert.NotEmpty(result.Data); @@ -27,16 +37,16 @@ public async Task GetAvailableCryptocurrencies() [Fact] public async Task GetDailyPrice() { - var result = await api.GetDailyPrices("BTCUSD"); + var result = await api.GetHistoricalQuoteAsync("BTCUSD"); result.AssertNoErrors(); - Assert.NotEmpty(result.Data.HistoricalPrices); + Assert.NotEmpty(result.Data.Historical); } [Fact] public async Task GetPeriodPriceData() { - var result = await api.GetHistoricalPrices("BTCUSD", MatthiWare.FinancialModelingPrep.Model.HistoricalPricingPeriod.OneHour); + var result = await api.GetHistoricalQuoteAsync("BTCUSD", MatthiWare.FinancialModelingPrep.Model.HistoricalPricingPeriod.OneHour); result.AssertNoErrors(); Assert.NotEmpty(result.Data); diff --git a/Tests/Forex/ForexMarketTests.cs b/Tests/Forex/ForexMarketTests.cs new file mode 100644 index 0000000..5e7abc8 --- /dev/null +++ b/Tests/Forex/ForexMarketTests.cs @@ -0,0 +1,39 @@ +using MatthiWare.FinancialModelingPrep.Abstractions.Forex; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Threading.Tasks; +using Xunit; +using Xunit.Abstractions; + +namespace Tests.Forex +{ + public class ForexMarketTests : TestingBase + { + private readonly IForexMarketProvider api; + + public ForexMarketTests(ITestOutputHelper testOutput) : base(testOutput) + { + api = ServiceProvider.GetRequiredService(); + } + + [Fact] + public async Task GetCurrencyPairRealtime() + { + var result = await api.GetQuoteAsync("USDJPY"); + + result.AssertNoErrors(); + Assert.NotNull(result.Data); + Assert.Equal("USDJPY", result.Data[0].Symbol); + } + + [Fact] + public async Task GetCurrencyPairHistorical() + { + var result = await api.GetHistoricalQuoteAsync("USDJPY", MatthiWare.FinancialModelingPrep.Model.HistoricalPricingPeriod.OneMinute); + + result.AssertNoErrors(); + Assert.NotNull(result.Data); + Assert.NotNull(result.Data[0].Date); + } + } +} diff --git a/Tests/Futures/FuturesMarketTests.cs b/Tests/Futures/FuturesMarketTests.cs new file mode 100644 index 0000000..81bb735 --- /dev/null +++ b/Tests/Futures/FuturesMarketTests.cs @@ -0,0 +1,40 @@ +using MatthiWare.FinancialModelingPrep.Abstractions.Futures; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Threading.Tasks; +using Xunit; +using Xunit.Abstractions; + +namespace Tests.Futures +{ + public class FuturesMarketTests : TestingBase + { + private readonly IFuturesMarketProvider api; + + public FuturesMarketTests(ITestOutputHelper testOutput) : base(testOutput) + { + api = ServiceProvider.GetRequiredService(); + } + + [Fact] + public async Task GetCommodityRealtime() + { + var result = await api.GetQuoteAsync("LC=F"); + + result.AssertNoErrors(); + Assert.NotNull(result.Data); + // Commodity tickers are painful. + Assert.Equal("LCUSX", result.Data[0].Symbol); + } + + [Fact] + public async Task GetCurrencyPairHistorical() + { + var result = await api.GetHistoricalQuoteAsync("LC=F", MatthiWare.FinancialModelingPrep.Model.HistoricalPricingPeriod.OneMinute); + + result.AssertNoErrors(); + Assert.NotNull(result.Data); + Assert.NotNull(result.Data[0].Date); + } + } +} diff --git a/Tests/StockTimeSeries/StockTimeSeriesTests.cs b/Tests/StockTimeSeries/StockTimeSeriesTests.cs index 36a582e..718fc09 100644 --- a/Tests/StockTimeSeries/StockTimeSeriesTests.cs +++ b/Tests/StockTimeSeries/StockTimeSeriesTests.cs @@ -18,6 +18,15 @@ public StockTimeSeriesTests(ITestOutputHelper testOutput) : base(testOutput) api = ServiceProvider.GetRequiredService(); } + [Fact] + public async Task GetStockQuote() + { + var result = await api.GetQuoteAsync("AAPL"); + + result.AssertNoErrors(); + Assert.Equal("AAPL", result.Data[0].Symbol); + } + [Fact] public async Task GetHistoricalDividendsAsync() { @@ -27,7 +36,7 @@ public async Task GetHistoricalDividendsAsync() var dividend = result.Data.Historical.First(data => data.Date == "2021-05-07"); - Assert.Equal(0.22, dividend.Dividend); + Assert.Equal(0.22m, dividend.Dividend); Assert.Equal("2021-05-10", dividend.RecordDate); Assert.Equal("2021-05-13", dividend.PaymentDate); Assert.Equal("2021-04-28", dividend.DeclarationDate); @@ -42,8 +51,8 @@ public async Task GetHistoricalStockSplitsAsync() var split = result.Data.Historical.First(data => data.Date == "2020-08-31"); - Assert.Equal(4.0, split.Numerator); - Assert.Equal(1.0, split.Denominator); + Assert.Equal(4.0m, split.Numerator); + Assert.Equal(1.0m, split.Denominator); } [Fact] @@ -55,10 +64,10 @@ public async Task GetHistoricalDailyPricesAsync() var split = result.Data.Historical.First(data => data.Date == "2021-06-04"); - Assert.Equal(125.89, split.Close, 2); - Assert.Equal(124.07, split.Open, 2); - Assert.Equal(126.16, split.High, 2); - Assert.Equal(123.85, split.Low, 2); + Assert.Equal(125.89d, split.Close, 2); + Assert.Equal(124.07d, split.Open.Value, 2); + Assert.Equal(126.16d, split.High.Value, 2); + Assert.Equal(123.85d, split.Low.Value, 2); } [Fact] @@ -72,10 +81,10 @@ public async Task GetHistoricalDailyPricesUsingFromToAsync() var split = result.Data.Historical.First(data => data.Date == "2021-06-04"); - Assert.Equal(125.89, split.Close, 2); - Assert.Equal(124.07, split.Open, 2); - Assert.Equal(126.16, split.High, 2); - Assert.Equal(123.85, split.Low, 2); + Assert.Equal(125.89d, split.Close, 2); + Assert.Equal(124.07d, split.Open.Value, 2); + Assert.Equal(126.16d, split.High.Value, 2); + Assert.Equal(123.85d, split.Low.Value, 2); } [Fact] @@ -87,29 +96,7 @@ public async Task GetHistoricalDailyPricesForLineChartAsync() var split = result.Data.Historical.First(data => data.Date == "2021-06-04"); - Assert.Equal(125.89, split.Close, 2); - } - - [Theory] - [MemberData(nameof(AvailableHistoricalChartSeries))] - public async Task GetHistoricalPricesForChartWithVolume(HistoricalChartSeries series) - { - var result = await api.GetHistoricalPricesForChartWithVolume("AAPL", series); - - result.AssertNoErrors(); - - Assert.True(result.Data.Count > 0); - } - - [Theory] - [MemberData(nameof(AvailableHistoricalChartSeries))] - public async Task GetHistoricalPricesForChartWithVolume2(HistoricalChartSeries series) - { - var result = await api.GetHistoricalPricesForChartWithVolume("AGS.BR", series); - - result.AssertNoErrors(); - - Assert.True(result.Data.Count > 0); + Assert.Equal(125.89m, split.Close, 2); } [Fact] @@ -123,18 +110,7 @@ public async Task GetHistoricalDailyPricesForLineChartUsingFromToAsync() var split = result.Data.Historical.First(data => data.Date == "2021-06-04"); - Assert.Equal(125.89, split.Close, 2); - } - - public static IEnumerable AvailableHistoricalChartSeries - { - get - { - foreach (var enumValue in Enum.GetValues()) - { - yield return new object[] { enumValue }; - } - } + Assert.Equal(125.89m, split.Close, 2); } } } diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 996df16..96febfa 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -1,7 +1,7 @@ - net5.0 + net8.0 false