1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

RIOT API doesn't return some info

Discussão em 'Angular' iniciado por Fyrlian, Julho 29, 2025.

  1. Fyrlian

    Fyrlian Guest

    I am creating a really basic app to show information about League of Legends profiles (similar to OP.GG, lolskill…)

    The technologies that I’m using currently are .NET for the back and the services that send the request to RIOT’s API and Angular for the front-end.

    The endpoint that returns information about the games that have been played is the following: /lol/match/v5/matches/{matchId}

    I’ve got all the DTOs needed to store the info and created both controllers and services. The request is valid and the information is retrieved correctly. However when I show the properties in the front every property is shown except the summoner game name.

    Is it an error on my app or is it the logic behinds Riot API to not return such information unless the app is in production or something similar?

    These are the service and the controller on the back-end:

    Service:

    public async Task<MatchDto> getMatchInfo(string region, string matchId){
    var url = $"https://{region}.api.riotgames.com/lol/match/v5/matches/{matchId}";
    _logger.LogInformation("URL: {url}", url);

    //creates the request and adds the api key.
    var request = new HttpRequestMessage(HttpMethod.Get, url);
    request.Headers.Add("X-Riot-Token", _apiKey);

    //stores the response
    var response = await _httpClient.SendAsync(request);

    if (!response.IsSuccessStatusCode)
    {
    return null;
    }

    //stores the content of the response
    var json = await response.Content.ReadAsStringAsync();

    //deseriales the JSON matching the clasas MatchDto properties (not caring about uppercase)
    var matchInfo = JsonSerializer.Deserialize<MatchDto>(json, new JsonSerializerOptions
    {
    PropertyNameCaseInsensitive = true
    });

    //returns the information
    return matchInfo;
    }

    Continue reading...

Compartilhe esta Página