MatthiWare / YahooFinance.Core

:chart_with_upwards_trend: A simple Yahoo Finance API made in .NET Standard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.NET Core AppVeyor Issues License Nuget

YahooFinance.Core

A simple Yahoo Finance API made in .NET Standard

Usage

API

All API calls return an IApiResponse<TData> object.

Using DI
using MatthiWare.YahooFinance.Core.Extensions;

services.AddYahooFinance();
Using constructor
using MatthiWare.YahooFinance;

var client = new YahooFinanceClient();
Searching for Symbol or ISIN
var client = new YahooFinanceClient();

// returns a list of search results, first item being the best matching.
var result = await client.Search.SearchAsync("Symbol or ISIN");
Get Quote
var client = new YahooFinanceClient();

// Returns a list of quote results
var result = await client.Quote.LookupAsync("Symbol or list of symbols");
Get Dividend History
using NodaTime;

var client = new YahooFinanceClient();

// returns a list of all dividends in a given period.
var result = await client.History.GetDividendsAsync("Symbol", clock.GetCurrentInstant().Minus(Duration.FromDays(365)), clock.GetCurrentInstant());
Get Stock Splits
using NodaTime;

var client = new YahooFinanceClient();

// returns a list of all stock splits in a given period.
var result = await client.History.GetSplitsAsync("Symbol", clock.GetCurrentInstant().Minus(Duration.FromDays(365)), clock.GetCurrentInstant());
Get Prices History
using NodaTime;

var client = new YahooFinanceClient();

// returns a list of all prices in a given period.
var result = await client.History.GetPricesAsync("Symbol", clock.GetCurrentInstant().Minus(Duration.FromDays(365)), clock.GetCurrentInstant());

About

:chart_with_upwards_trend: A simple Yahoo Finance API made in .NET Standard

License:GNU General Public License v3.0


Languages

Language:C# 91.4%Language:PowerShell 8.4%Language:Shell 0.2%