Coder Social home page Coder Social logo

hal-nine-thousand / financialmodelingprep.net Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matthiware/financialmodelingprep.net

0.0 0.0 0.0 302 KB

:chart_with_upwards_trend: C# API Client For financialmodelingprep.com API written in .NET 5

Home Page: https://financialmodelingprep.com/

License: MIT License

C# 100.00%

financialmodelingprep.net's Introduction

FinancialModelingPrep.NET

.NET Nuget

.NET 5 API Client For https://financialmodelingprep.com/ API written in C#

Installation

PM> Install-Package MatthiWare.FinancialModelingPrep

Quick Start

Register FinancialModelingPrepApiClient in Dependency Injection provider

You can find your API Key here https://financialmodelingprep.com/developer/docs/dashboard

using MatthiWare.FinancialModelingPrep;

Services.AddFinancialModelingPrepApiClient(new FinancialModelingPrepOptions() 
{
    ApiKey = "API-KEY-HERE"
});

var api = ServiceProvider.GetRequiredService<IFinancialModelingPrepApiClient>();

// do something with api like getting the latest Apple Stock Quote
var quoteResult = await api.CompanyValuation.GetQuoteAsync("AAPL");

Create FMP API Client using Factory (without Dependency Injection)

using MatthiWare.FinancialModelingPrep;

var api = FinancialModelingPrepApiClientFactory.CreateClient(new FinancialModelingPrepOptions());

// do something with api like getting the latest Apple Stock Quote
var quoteResult = await api.CompanyValuation.GetQuoteAsync("AAPL");

Get Stock Price Quote

var response = await api.CompanyValuation.GetQuoteAsync("AAPL");

// Display Apple Stock Quote
Console.WriteLine($"$AAPL is currently trading at: {response.Data.Price}");

All API Responses are wrapped in an ApiResponse<T> object.

public class ApiResponse<T>
{
    /// <summary>
    /// Error message if any occured
    /// </summary>
    public string Error { get; }

    /// <summary>
    /// True if there was an error with the request otherwise false
    /// </summary>
    public bool HasError { get; }

    /// <summary>
    /// The FMP API response object <see cref="T"/>
    /// </summary>
    public T Data { get; }
}

Example:

var response = await api.CompanyValuation.GetQuoteAsync("AAPL");

// Display Apple Stock Quote
if (!quoteResult.HasError)
{
   Console.WriteLine($"$AAPL is currently trading at: {response.Data.Price}");
} 
else 
{
   Console.WriteLine($"Error occured, message: {response.Error}");
}

Covered Endpoints

  • Company Valuation
  • Advanced Data
  • Insider Trading (Not yet covered)
  • Calendars
  • Instituational Fund
  • Stock Time Series (Partially covered)
  • Technical Indicators (Not yet covered)
  • Stock Statistics (Partially covered)
  • Market Indexes
  • Alternative Data (Not yet covered)
  • Commodities (Not yet covered)
  • ETF (Not yet covered)
  • Mutual Funds (Not yet covered)
  • Euronext
  • TSX
  • Stock Market (Partially covered)
  • Cryptocurrencies (Not yet covered)
  • Forex (Not yet covered)

Contribute

Create a PR where you add or improve an Endpoint

financialmodelingprep.net's People

Contributors

dependabot[bot] avatar hal-nine-thousand avatar matthiee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.