This project is a .NET wrapper for the Trading212 Public API (v0), designed to simplify integration and interaction with Trading212's endpoints. It provides a clean, organized structure to manage live and demo environments, as well as facilitate API calls in a straightforward manner.
- Seamless integration with Trading212 Public API (v0).
- Switch easily between demo and live environments.
- Simplified access to API endpoints.
- .NET 6.0 or later
- Access to Trading212 API (via API key)
To use this wrapper in your .NET project, add it as a dependency using your preferred method:
- Clone or download this repository.
- Add the project to your solution and reference it in your application.
- Add your "ApiKey" secret
-
Create the API Client: Use the
ApiClientFactoryto initialize the client.var apiClient = ApiClientFactory.Create(isDemo: true);
-
Call API Methods: Interact with the API using the methods provided by
TradingApiClient.var exchanges = await apiClient.GetExchangesAsync(); foreach (var exchange in exchanges) { Console.WriteLine(exchange); }
var apiClient = ApiClientFactory.Create(isDemo: true);
var exchanges = await apiClient.GetExchangesAsync();
foreach (var exchange in exchanges)
{
Console.WriteLine(exchange);
}var instruments = await apiClient.GetInstrumentsAsync();
foreach (var instrument in instruments)
{
Console.WriteLine(instrument);
}For questions or feedback, feel free to contact me:
- Email: akaantoninox@gmail.com
- GitHub: akaAntox