File | Date | Author | Commit |
---|---|---|---|
Folidata.Examples.CSharp | 2022-11-02 |
![]() |
[a84b06] package version |
Folidata.Examples.CSharp.Tests | 2022-11-01 |
![]() |
[64c9fe] disabled future api in test project (future api... |
.gitignore | 2022-10-31 |
![]() |
[2442cd] Initial commit |
Folidata.Examples.CSharp.sln | 2022-10-31 |
![]() |
[809a8c] initial commit |
README.md | 2022-11-02 |
![]() |
[d307a6] Revert "changed project url to github" |
This c# example libary is a SDK for the folidata finance api service.
With this SDK you can download end-of-day historic stock prices and prices for other assets like cryptos, indices, etc.
This C# example library is an SDK for the folidata finance API service.
With this SDK you can download end-of-day historic stock prices and prices for other assets like cryptos, indices, etc.
To use this API you need an API key. You can register for a free API key at www.folidata.com. Actually, the site language is in German.
With a free account you can use this API for 100 API calls a day.
For more API calls you can submit for a paid package.
A full documentation is available under this link (actually in German).
But the API is easy to use:
With the following code, you init the http client with your personal API key:
using Folidata;
var key = "YOUR_API_KEY";
var api = new FolidataApi(key);
To get the full list of supported exchanges use this code:
var exchanges = await _api.GetExchangeAsync();
Then you can get all the symbols of a stock exchange:
var exchanges = await _api.GetSymbolsAsync("US");
Other supported lists to get the supported symbols:
- Crypto GetCryptosAsync()
- Forex Pairs GetForexAsync()
Just one line of code is enough to get the all historic prices for the apple stock.
var prices = await api.GetPricesAsync("AAPL.US");
To get data for a specific day:
var prices = await api.GetPriceAsync("AAPL.US",new DateTime(2022, 01, 02));
For a specific time range:
var prices = await api.GetPricesAsync("AAPL.US",new DateTime(2021, 01, 02), new DateTime(2022, 06, 01));
Sort the result:
var prices = await api.GetPricesAsync("AAPL.US", new DateTime(2021, 01, 02), new DateTime(2022, 06, 01), Folidata.Utils.SortMode.DESC);
Limit the results:
var prices = await api.GetPricesAsync("AAPL.US", new DateTime(2021, 01, 02), new DateTime(2022, 06, 01), Folidata.Utils.SortMode.DESC, 100);
All given parameters/methods are also possible in the following methods:
- GetCryptoPricesAsync("SHIB-USD")
- GetForexPricesAsync("USDEUR")
- GetIndexPricesAsync("GDAXP")
To check your current limits and datapoints count:
var state = await api.GetKeyStateAsync();
Die vollständige Dokumentation ist unter folgenden Link zu finden.
Mit dem folgenden Code initialisierst du den HTTP Client mit deinem persönlichen API Key:
using Folidata;
var key = "YOUR_API_KEY";
var api = new FolidataApi(key);
Eine vollständige Liste aller unterstützten Handelsplätze erhälst du mir nur einer Zeile Code:
var exchanges = await _api.GetExchangeAsync();
Um alle unterstützen Symbole zu erhalten:
var exchanges = await _api.GetSymbolsAsync("US");
Um weitere unterstütze Symbole zu erhalten verwende folgende Methoden:
- Crypto GetCryptosAsync()
- Forex Pairs GetForexAsync()
Mit einer Zeile Code erhälst du alle historischen Kurse der Apple Aktie.
var prices = await api.GetPricesAsync("AAPL.US");
Um die Kursdaten eines spezifischen Tages zu erhalten:
var prices = await api.GetPriceAsync("AAPL.US",new DateTime(2022, 01, 02));
Zeitspanne:
var prices = await api.GetPricesAsync("AAPL.US",new DateTime(2021, 01, 02), new DateTime(2022, 06, 01));
Sortieren der Ergebnisse:
var prices = await api.GetPricesAsync("AAPL.US", new DateTime(2021, 01, 02), new DateTime(2022, 06, 01), Folidata.Utils.SortMode.DESC);
Limittieren der Ergebnisse:
var prices = await api.GetPricesAsync("AAPL.US", new DateTime(2021, 01, 02), new DateTime(2022, 06, 01), Folidata.Utils.SortMode.DESC, 100);
Alle oben beschriebenen Parameter gelten auch für die folgenden Kursabfragen:
- GetCryptoPricesAsync("SHIB-USD")
- GetForexPricesAsync("USDEUR")
- GetIndexPricesAsync("GDAXP")
Um die Limits und aktuellen verbrauchten Datenpunkte zu sehen:
var state = await api.GetKeyStateAsync();