Skip to content

NordPool/public-intraday-api-net-example

Repository files navigation

Nord Pool Intraday API .NET Example Code

This repository contains a .NET 8 Console example application for interaction with Nord Pool Intraday Trading platform. The respective documentation is located at our Development Portal.

This sample application uses .NET data objects published in .NET API library

There is also sample Java application available at https://github.com/NordPool/public-intraday-api.

Disclaimer

We offer the client code examples to aid the development against Nord Pool's API at no warranty whatsoever. Clients are solely responsible for separately testing and ensuring that interaction with Nord Pool works according to their own standards.

Example application requires .NET 8. If you have not support for .NET 8. in your Visual Studio, install developer SDK from (https://dotnet.microsoft.com/en-us/download/dotnet/8.0).

Building

Example application can be opened with solution file: NPS.ID.PublicApi.DotNet.Client.sln which is found in repository root.

Example application requires, that you have cloned .NET API library to your filesystem besides to this example app. Your local repository configuration can be for example:

#!
C:\[path]\public-intraday-net-api
C:\[path]\public-intraday-api-net-example

.NET Example client solution contains Api library-project including source code from public-intraday-net-api repository. .NET API library reference is always to the same version of the library than exists in disk.

All the relevant variables for connecting are located in appsettings.json. Before running the example, user credentials should be updated to appsettings.json:

#!
"Credentials": {
    "Username": "your_user",
    "Password": "your_password"
}

These credentials shall be obtained from idapi@nordpoolgroup.com prior to running the example.

Additionally, make sure that all the other variables in the appsettings.json file point to correct addresses. Finally, build the solution with Visual Studio or with dotnet CLI and run it with startup project: NPS.ID.PublicApi.DotNet.Client.

The program will create two parallel connections that targets both: Market Data web service and Trading web service. Each connection subscribes to several example topics. It also provides examples on sending order messages to Intraday platform.

Every communication step, its results or exceptions are printed in console output window.

The sequence of actions are located in ApplicationWorker.cs source code which is triggered once the program has started.

Important considerations

The current program is using the native .NET ClientWebSocket library and Stomp.Net library to create a WebSocketConnector that can operate through web sockets and handle all SockJS related details. In addition, sending heartbeat task created after connection established and refreshing access token are also defined in the WebSocketConnector. That connector can be found from WebSocketConnector.cs. Heartbeat interval configuration can be found in appsettings.json HeartbeatOutgoingInterval property.

The example uses port 443(secured) for establishing the web socket connection with Trading and Market Data web services. If the example doesn't connect to the API, check that the above ports has been opened from your firewall.

Questions, comments and error reporting

Please send questions and bug reports to idapi@nordpoolgroup.com.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages