A simple C# library to connect to GME API service to download market data. This is an unofficial library and an indipendent project in anyway not affiliate with GME (https://www.mercatoelettrico.org/en-us/Home/APIServicePreview).
var connector = new Connector("https://api.mercatolettrico.org/request");
AuthRequest authRequest = new AuthRequest()
{
Login = "my_login",
Password = "my_password"
};
string jwtToken = "";
AuthResponse authResponse = (AuthResponse)await connector.Authenticate(authRequest);
if(authResponse.Success)
{
jwtToken = authResponse.Token;
}
Request req1 = new Request() {
DataName = "ME_ZonalPrices",
IntervalStart = 20251001,
IntervalEnd = 20251001,
Segment = "MGP",
Attributes = new Dictionary<string, string>()
};
Response response = (Response)await connector.RequestData(req1);
connector.UnzipResult("C:\\20251001MGPZonalPrices.json", response.ContentResponse);
IQuotasResponse quotas = await connector.GetMyQuotas();
Console.WriteLine("Connection Per minutes: {0}", quotas.ConnectionsPerMinute);
The library is used by the free tool GmeApiMarketDataDownloader available here: https://baltz.altervista.org/#portfolio