Skip to content

Ranked Leagues

Antoine CLOP edited this page Aug 2, 2020 · 4 revisions

Ranked / Leagues

Leagues are group of summoners of the same skill level. The following methods can help getting some player statistics such as win rate or ranking level.

Methods

ChallengerLeague

Parameters

  • Queue: The ranked queue of desired challenger league. To create a Queue object, you'll be asked for an enum parameter containing .Unknown. Do not use this value or nil will be returned by initializer. This value is present only for internal usage and keeping compatibility with future Riot API queue values.
  • Region: The region of desired challenger league.

Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (League?, String?). League contains all league related informations and will be nil only if an error occured. The String parameter contains the first error description encountered if existing.

Usage example

guard let queue = Queue(.RankedSolo5V5) else { return }
league.lolAPI.getChallengerLeague(for: queue, on: .EUW) { (league, errorMsg) in
    if let league = league {
        print("Success!")
        }
    else {
        print("Request failed cause: \(errorMsg ?? "No error description")")
    }
}

GrandMasterLeague

Parameters

  • Queue: The ranked queue of desired grand master league. To create a Queue object, you'll be asked for an enum parameter containing .Unknown. Do not use this value or nil will be returned by initializer. This value is present only for internal usage and keeping compatibility with future Riot API queue values.
  • Region: The region of desired grand master league.

Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (League?, String?). League contains all league related informations and will be nil only if an error occured. The String parameter contains the first error description encountered if existing.

Usage example

guard let queue = Queue(.RankedSolo5V5) else { return }
league.lolAPI.getGrandMasterLeague(for: queue, on: .EUW) { (league, errorMsg) in
    if let league = league {
        print("Success!")
    }
    else {
        print("Request failed cause: \(errorMsg ?? "No error description")")
    }
}

MasterLeague

Parameters

  • Queue: The ranked queue of desired master league. To create a Queue object, you'll be asked for an enum parameter containing .Unknown. Do not use this value or nil will be returned by initializer. This value is present only for internal usage and keeping compatibility with future Riot API queue values.
  • Region: The region of desired master league.

Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (League?, String?). League contains all league related informations and will be nil only if an error occured. The String parameter contains the first error description encountered if existing.

Usage example

guard let queue = Queue(.RankedSolo5V5) else { return }
league.lolAPI.getMasterLeague(for: queue, on: .EUW) { (league, errorMsg) in
    if let league = league {
        print("Success!")
    }
    else {
        print("Request failed cause: \(errorMsg ?? "No error description")")
    }
}

RankedEntries

Parameters

  • SummonerId: Represents the unique identifier of a summoner. See Summoners to get this identifier.
  • Region: The region where the summoner plays.

Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: ([RankedEntry]?, String?). RankedEntry array contains all summoner's ranked informations for all queues and will be nil only if summoner was not found on this region or has not played ranked games this season. The String parameter contains the first error description encountered if existing.

Usage example

league.lolAPI.getRankedEntries(for: SummonerId("xc8IRVLGV1Gb75sbz8JoLdRvIJ_yAKNsSG1RBQVtnGZqZV8"), on: .EUW) { (rankedEntries, errorMsg) in
    if let rankedEntries = rankedEntries {
        print("Success!")
    }
    else {
        print("Request failed cause: \(errorMsg ?? "No error description")")
    }
}

RankedEntry

Parameters

  • SummonerId: Represents the unique identifier of a summoner. See Summoners to get this identifier.
  • Queue: The ranked queue of desired league. To create a Queue object, you'll be asked for an enum parameter containing .Unknown. Do not use this value or nil will be returned by initializer. This value is present only for internal usage and keeping compatibility with future Riot API queue values.
  • Region: The region where the summoner plays.

Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (RankedEntry?, String?). RankedEntry contains all summoner's ranked informations for the specified queue and will be nil only if summoner was not found on this region or has not played ranked games in the specified queue this season. The String parameter contains the first error description encountered if existing.

Usage example

guard let queue = Queue(.RankedSolo5V5) else { return }
league.lolAPI.getRankedEntry(for: SummonerId("xc8IRVLGV1Gb75sbz8JoLdRvIJ_yAKNsSG1RBQVtnGZqZV8"), in: queue, on: .EUW) { (rankedEntry, errorMsg) in
    if let rankedEntry = rankedEntry {
        print("Success!")
    }
    else {
        print("Request failed cause: \(errorMsg ?? "No error description")")
    }
}

League

Parameters

  • LeagueId: Represents the unique identifier of a league. To get this identifier, you must request RankedPositions or RankedPosition first.
  • Region: The region where league with LeagueId exists.

Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (League?, String?). League contains all league related informations and will be nil only if league does not exists on the specified region. The String parameter contains the first error description encountered if existing.

Usage example

league.lolAPI.getLeague(by: LeagueId("e817b750-fc49-11e7-97bd-c81f66dd0e0d"), on: .EUW) { (league, errorMsg) in
    if let league = league {
        print("Success!")
    }
    else {
        print("Request failed cause: \(errorMsg ?? "No error description")")
    }
}

QueueEntries

Parameters

  • Region: The region to execute the request against.
  • Queue: The ranked queue desired.
  • RankedDivision: The full division desired (Tier + Division). Tier starts from IRON to DIAMOND and division starts from 4 ("IV") to 1 ("I").
  • Page: Optional parameter specifying the desired page result starting at 1.

Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: ([RankedEntry]?, String?). The result of this request contain players information in the specified division/queue. See RankedEntry. The String parameter contains the first error description encountered if existing.

Usage example

guard let queue = Queue(.RankedSolo5V5) else { return }
guard let tier = RankedTier(.Diamond) else { return }
league.lolAPI.getQueueEntries(on: .EUW, queue: queue, division: RankedDivision(tier: tier, divisionRoman: "I")) { (entries, errorMsg) in
    if let entries = entries {
        print("Success!")
    }
    else {
        print("Request failed cause: \(errorMsg ?? "No error description")")
    }
}