Skip to main content

Method signature

async def GET_getMatchlist(
    self,
    puuid: str,
    region: str
) -> Union[MatchlistDto, Dict]
Get matchlist for games played by a player identified by their PUUID.

Parameters

puuid
string
required
The player’s unique PUUID. Can be obtained from account endpoints like GET_getByRiotId.
region
string
required
The region to execute against. Must be one of: ap, br, esports, eu, kr, latam, na.

Returns

MatchlistDto
object
Match history data for the specified player.
When raw_data=True is set on the client, this method returns a Dict instead of a MatchlistDto object.

Exceptions

  • InvalidRegion: If the provided region is invalid.
  • RiotAPIResponseError: If the API response indicates an error (e.g., player not found).

Example

import asyncio
from valaw import Client

async def main():
    client = Client(
        token="RGAPI-your-token-here",
        cluster="americas"
    )
    
    # First, get the player's PUUID
    account = await client.GET_getByRiotId(
        gameName="PlayerName",
        tagLine="NA1"
    )
    
    # Get their match history
    matchlist = await client.GET_getMatchlist(
        puuid=account.puuid,
        region="na"
    )
    
    print(f"Found {len(matchlist.history)} matches")
    for entry in matchlist.history[:5]:  # Show first 5
        print(f"Match: {entry.matchId}")
        print(f"  Queue: {entry.queueId}")
    
    await client.close()

asyncio.run(main())

Build docs developers (and LLMs) love