Skip to content

baltazzar85/gmeapilib

Repository files navigation

GmeApiLib

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).

How to use:

Connect to API with credentials

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;
}

Download data

  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);

Request my quotas

  IQuotasResponse quotas = await connector.GetMyQuotas();
  Console.WriteLine("Connection Per minutes: {0}", quotas.ConnectionsPerMinute);

Who is using it

The library is used by the free tool GmeApiMarketDataDownloader available here: https://baltz.altervista.org/#portfolio

About

API in c# to connect to API of GME for market results

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages