Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions NOTICE.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

This project includes data from the following external resources:

1. **Xetra Instruments Data**:
- URL: https://www.xetra.com/resource/blob/1528/76087c675c856fe7720917da03a62a34/data/t7-xetr-allTradableInstruments.csv
- License: Please refer to Xetra's terms of service or data usage policy at https://www.xetra.com/xetra-de/instrumente/alle-handelbaren-instrumente

2. **S&P 500 Symbols (DatahubIo)**:
- URL: https://raw.githubusercontent.com/datasets/s-and-p-500-companies-financials/refs/heads/main/data/constituents-financials.csv
- License: This dataset is licensed under the Public Domain Dedication and License (PDDL). The PDDL allows unrestricted use, sharing, modification, and distribution of the data for any purpose, including commercial use.
- Notice: The PDDL allows unrestricted use, modification, and distribution of the data. The MIT/BSD licenses permit free use of the code with attribution and disclaimers. While formal credit is not required, it is recommended to include a link back or provide credit to Rufus Pollock and the Open Knowledge Foundation.

3. **NASDAQ Symbols (DatahubIo)**:
- URL: https://raw.githubusercontent.com/datasets/nasdaq-listings/refs/heads/main/data/nasdaq-listed-symbols.csv
- License: This dataset is licensed under the Public Domain Dedication and License (PDDL). The PDDL allows unrestricted use, sharing, modification, and distribution of the data for any purpose, including commercial use.
- Notice: The data originates from the NASDAQ OMX Group, which retains copyright over the original information. Users should review the copyright notice of the source dataset to ensure compliance with any specific restrictions regarding public or commercial use.
- Source Data Copyright: Copyright © 2010, The NASDAQ OMX Group, Inc. All rights reserved.

4. **Yahoo Finance Data**:
- URL: https://finance.yahoo.com/
- License: Please review Yahoo Finance's terms of service at https://legal.yahoo.com/us/en/yahoo/terms/otos/index.html

5. **Alpha Vantage API**:
Usage: This application uses the Alpha Vantage API to retrieve financial data. The API is used in accordance with Alpha Vantage's Terms of Service.
Attribution Requirement:Per Alpha Vantage's terms, users must provide attribution to Alpha Vantage when displaying data retrieved from the API.
Note: For more information, visit the Alpha Vantage API Documentation https://www.alphavantage.co/documentation/.


Please review the associated licenses to ensure proper usage and attribution.
93 changes: 63 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,42 @@
[![NuGet Downloads](https://img.shields.io/nuget/dt/Finance.NET.svg)](https://www.nuget.org/packages/Finance.NET)
[![Star this repo](https://img.shields.io/github/stars/thorstenalpers/Finance.NET.svg?style=social&label=Star&maxAge=60)](https://github.com/thorstenalpers/Finance.NET)

An easy-to-use .NET library for accessing and aggregating financial data from multiple sources. This library provides functionality to retrieve financial information through APIs and HTML scraping from various providers.
An easy-to-use .NET library for accessing and aggregating financial data from multiple sources.

## Features
This library enables developers to retrieve financial data via APIs and HTML scraping from a variety of providers. It's ideal for building analytical tools, dashboards, or financial applications that require access to market data.

* **Retrieve Instruments:** Access tradable ticker symbols and related details for financial instruments.
* **Fundamentals:** Fetch key financial metrics and company fundamentals.
* **Historical Records:** Obtain historical data for charting or analysis.
* **Real-Time Quotes:** Get live updates on stock prices and other market data.
---

## Table of contents
## ⭐ Features

* [Getting started](#getting-started)
* [Services](#services)
* [Yahoo! Finance](#yahoo-finance)
* [Alpha Vantage](#alpha-vantage)
* [DataHub](#datahub)
* [Xetra](#xetra)
* [Disclaimer](#disclaimer)
* **Retrieve Instruments:** Get tradable ticker symbols and associated details.
* **Fundamentals:** Access key financial metrics and company fundamentals.
* **Historical Records:** Fetch historical data for analysis or charting.
* **Real-Time Quotes:** Receive live updates on stock prices and market data.

## Getting started
---

## 🚀 Getting started

This section guides you through installing Finance.NET, configuring services, and basic data retrieval.

### Installation

To integrate Finance .NET into your project, install it via NuGet.
Install via NuGet:

```shell
dotnet add package Finance.NET
```

### Adding to Service Collection
### Register in Service Collection

Register Finance .NET in your service collection to enable dependency injection.
Add Finance.NET to your service collection for dependency injection:

```csharp
services.AddFinanceNet();
```

You can also provide a custom configuration.
Optional: Configure with custom settings.

```csharp
services.AddFinanceNet(new FinanceNetConfiguration
Expand All @@ -59,7 +57,7 @@ services.AddFinanceNet(new FinanceNetConfiguration

### Basic Usage

To fetch historical records and the latest ticker for Tesla stock.
Example: Retrieve historical and real-time data for Tesla (TSLA):

```csharp
public async Task Run(IYahooFinanceService yahooService)
Expand All @@ -78,13 +76,18 @@ public async Task Run(IYahooFinanceService yahooService)
}
```

## Services
---

## Yahoo! Finance
## 🔌Finance.NET Service Interfaces

[Yahoo! Finance](https://finance.yahoo.com/) is one of the most popular platforms for market data, company fundamentals, historical records, and real-time stock quotes.
Finance.NET exposes modular service interfaces for accessing diverse financial data through a consistent API. Each interface corresponds to a specific provider and supports its unique features.

### Methods

### Yahoo! Finance

Provides market data, company fundamentals, historical records, and real-time quotes.

#### Methods

<details><summary><code>GetInstrumentsAsync</code></summary>

Expand Down Expand Up @@ -528,9 +531,12 @@ public async Task Run(IYahooFinanceService yahooService)

</details>

---

## Alpha Vantage

[Alpha Vantage](https://www.alphavantage.co) is a well-regarded provider of stock, forex, and cryptocurrency data, offering historical records and intraday prices.
Offers stock, forex, and cryptocurrency data including intraday and historical records.


### Get an API key

Expand Down Expand Up @@ -791,9 +797,11 @@ public async Task Run(IAlphaVantageService alphaVantageService)

</details>

---

## DataHub

[DataHub](https://datahub.io) is a popular source for accessing comprehensive data, including Nasdaq and S&P 500 companies.
Accesses datasets like Nasdaq and S&P 500 companies.

### Methods

Expand Down Expand Up @@ -876,9 +884,11 @@ public async Task Run(IDataHubService datahubService)

</details>

---

## Xetra

[Xetra](https://www.xetra.com/) is a leading European electronic trading platform, widely known for providing access to financial instruments listed on the Xetra market.
A major European trading platform offering data on Xetra-listed instruments.

### Methods

Expand Down Expand Up @@ -924,13 +934,36 @@ public async Task Run(IXetraService xetraService)

<div style="height: 1px;"></div>

## Disclaimer
---

## 🤝 How to Contribute

Finance .NET is an open-source tool that uses Yahoo's and other publicly available APIs, and is intended for research and educational purposes.
We welcome contributions to Finance.NET! If you’d like to improve the project, please:

#### Wen using the following services, you should refer to their respective terms of use
1. Check out our [contributing guidelines](CONTRIBUTING.md).
2. Ideally, open an issue before starting work.
3. Submit a pull request with your changes.

Thank you for helping make Finance.NET better!

---

## ℹ️ Disclaimer

Finance.NET is an open-source project using publicly accessible APIs and scraping techniques. It is intended for educational and research purposes.

For legal usage, refer to the terms of each data provider:

* Alpha Vantage: [Terms of use](https://www.alphavantage.co/)
* DataHub: [S&P 500 Companies Terms of Use](https://github.com/datasets/s-and-p-500-companies), [NASDAQ Listings Terms of Use](https://github.com/datasets/nasdaq-listings)
* Yahoo! Finance: [API Terms of Use](https://policies.yahoo.com/us/en/yahoo/terms/product-atos/apiforydn/index.htm), [Website Terms of Use](https://legal.yahoo.com/us/en/yahoo/terms/otos/index.html), [General Terms](https://policies.yahoo.com/us/en/yahoo/terms/index.htm)
* Xetra: [Terms of use](https://www.xetra.com/xetra-de/instrumente/alle-handelbaren-instrumente)


For additional licensing and attribution details, see [NOTICE.md](./NOTICE.md) and [THIRD_PARTY_LICENSES.md](./THIRD_PARTY_LICENSES.md).

---

## 🐞 Report a Bug

If you encounter any issues or bugs, please [report them here](https://github.com/thorstenalpers/Finance.NET/issues).
61 changes: 28 additions & 33 deletions licenses.txt → THIRD_PARTY_LICENSES.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
####################################################################################################
Package:AngleSharp
Version:1.1.2
Version:1.3.0
project URL:https://anglesharp.github.io/
Description:AngleSharp is the ultimate angle brackets parser library. It parses HTML5, CSS3, and XML to construct a DOM based on the official W3C specification.
licenseUrl:https://licenses.nuget.org/MIT
license Type:MIT

####################################################################################################
Package:AngleSharp.XPath
Version:2.0.4
Version:2.0.5
project URL:https://github.com/AngleSharp/AngleSharp.XPath/
Description:XPath support for AngleSharp
licenseUrl:https://licenses.nuget.org/MIT
Expand All @@ -24,7 +24,7 @@ license Type:LICENSE

####################################################################################################
Package:AutoMapper
Version:10.0.1
Version:10.1.1
project URL:https://automapper.org/
Description:A convention-based object-object mapper.
licenseUrl:https://licenses.nuget.org/MIT
Expand All @@ -38,6 +38,22 @@ Description:A library for reading and writing CSV files. Extremely fast, flexibl
licenseUrl:https://licenses.nuget.org/MS-PL%20OR%20Apache-2.0
license Type:MS-PL OR Apache-2.0

####################################################################################################
Package:Microsoft.Extensions.Configuration
Version:8.0.0
project URL:https://dot.net/
Description:Implementation of key-value pair based configuration for Microsoft.Extensions.Configuration. Includes the memory configuration provider.
licenseUrl:https://licenses.nuget.org/MIT
license Type:MIT

####################################################################################################
Package:Microsoft.Extensions.Configuration.UserSecrets
Version:8.0.1
project URL:https://dot.net/
Description:User secrets configuration provider implementation for Microsoft.Extensions.Configuration. User secrets mechanism enables you to override application configuration settings with values stored in the local secrets file. You can use UserSecretsConfigurationExtensions.AddUserSecrets extension method on IConfigurationBuilder to add user secrets provider to the configuration builder.
licenseUrl:https://licenses.nuget.org/MIT
license Type:MIT

####################################################################################################
Package:Microsoft.Extensions.Http
Version:6.0.1
Expand Down Expand Up @@ -68,12 +84,20 @@ license Type:MIT

####################################################################################################
Package:Newtonsoft.Json
Version:13.0.1
Version:13.0.3
project URL:https://www.newtonsoft.com/json
Description:Json.NET is a popular high-performance JSON framework for .NET
licenseUrl:https://licenses.nuget.org/MIT
license Type:MIT

####################################################################################################
Package:Polly
Version:8.5.2
project URL:https://github.com/App-vNext/Polly
Description:Polly is a .NET resilience and transient-fault-handling library that allows developers to express resilience and transient fault handling policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner.
licenseUrl:https://licenses.nuget.org/BSD-3-Clause
license Type:BSD-3-Clause

####################################################################################################
Package:System.ComponentModel.Annotations
Version:5.0.0
Expand All @@ -96,32 +120,3 @@ When using NuGet 3.x this package requires at least version 3.4.
licenseUrl:https://licenses.nuget.org/MIT
license Type:MIT


This project includes data from the following external resources:

1. **Xetra Instruments Data**:
- URL: https://www.xetra.com/resource/blob/1528/76087c675c856fe7720917da03a62a34/data/t7-xetr-allTradableInstruments.csv
- License: Please refer to Xetra's terms of service or data usage policy at https://www.xetra.com/xetra-de/instrumente/alle-handelbaren-instrumente

2. **S&P 500 Symbols (DatahubIo)**:
- URL: https://raw.githubusercontent.com/datasets/s-and-p-500-companies-financials/refs/heads/main/data/constituents-financials.csv
- License: This dataset is licensed under the Public Domain Dedication and License (PDDL). The PDDL allows unrestricted use, sharing, modification, and distribution of the data for any purpose, including commercial use.
- Notice: The PDDL allows unrestricted use, modification, and distribution of the data. The MIT/BSD licenses permit free use of the code with attribution and disclaimers. While formal credit is not required, it is recommended to include a link back or provide credit to Rufus Pollock and the Open Knowledge Foundation.

3. **NASDAQ Symbols (DatahubIo)**:
- URL: https://raw.githubusercontent.com/datasets/nasdaq-listings/refs/heads/main/data/nasdaq-listed-symbols.csv
- License: This dataset is licensed under the Public Domain Dedication and License (PDDL). The PDDL allows unrestricted use, sharing, modification, and distribution of the data for any purpose, including commercial use.
- Notice: The data originates from the NASDAQ OMX Group, which retains copyright over the original information. Users should review the copyright notice of the source dataset to ensure compliance with any specific restrictions regarding public or commercial use.
- Source Data Copyright: Copyright © 2010, The NASDAQ OMX Group, Inc. All rights reserved.

4. **Yahoo Finance Data**:
- URL: https://finance.yahoo.com/
- License: Please review Yahoo Finance's terms of service at https://legal.yahoo.com/us/en/yahoo/terms/otos/index.html

5. **Alpha Vantage API**:
Usage: This application uses the Alpha Vantage API to retrieve financial data. The API is used in accordance with Alpha Vantage's Terms of Service.
Attribution Requirement:Per Alpha Vantage's terms, users must provide attribution to Alpha Vantage when displaying data retrieved from the API.
Note: For more information, visit the Alpha Vantage API Documentation https://www.alphavantage.co/documentation/.


Please review the associated licenses to ensure proper usage and attribution.
4 changes: 4 additions & 0 deletions release-notes/v1.0.8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### What's Changed

* Updated NuGet package dependencies to latest versions for improved stability and compatibility.

16 changes: 8 additions & 8 deletions src/Finance.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<LangVersion>latest</LangVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<PackageId>Finance.NET</PackageId>
<Version>1.0.7</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<PackageId>Finance.NET</PackageId>
<Version>1.0.8</Version>
<Authors>Thorsten Alpers</Authors>
<Owners>Thorsten Alpers</Owners>
<Description>Access financial data from Yahoo Finance and other sources.</Description>
<PackageProjectUrl>https://github.com/thorstenalpers/Finance.NET</PackageProjectUrl>
<RepositoryUrl>https://github.com/thorstenalpers/Finance.NET</RepositoryUrl>
<PackageTags>Finance.NET;Yahoo;DataHub;Alpha Vantage;Nasdaq;Xetra;Finance;Trading</PackageTags>
<PackageTags>Finance.NET;Yahoo;Yahoo Finance;DataHub;Alpha Vantage;Nasdaq;Xetra;Finance;Trading</PackageTags>
<Copyright>Copyright 2024-2025</Copyright>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>logo.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AngleSharp" Version="1.1.2" />
<PackageReference Include="AngleSharp.XPath" Version="2.0.4" />
<PackageReference Include="AngleSharp" Version="1.3.0" />
<PackageReference Include="AngleSharp.XPath" Version="2.0.5" />
<PackageReference Include="Ardalis.GuardClauses" Version="5.0.0" />
<PackageReference Include="AutoMapper" Version="10.1.1" />
<PackageReference Include="CsvHelper" Version="33.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Polly" Version="7.2.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Polly" Version="8.5.2" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>

Expand Down
Loading