lol-docs

Public changelog website for

History Page

The History tab on a profile lets you browse and filter every match in that profile’s match history.

Enabling the History Page

  1. The history page is a Patreon supporter feature. Profiles without it only contain the 5 most recent matches.
  2. If you are subscribed on Patreon, log in to the account management portal, enable the history feature, and update your profile again.
  3. The history feature can only be enabled for a Riot account you own.
  4. The first visit to the history page may take a moment while your match history is downloaded. Later visits load from your browser’s cache until the profile is updated again.

Standard Filters

Standard Filters is the default mode. Set up any rules you want, then press Apply filters. Every active rule must match. Comma-separated names within one rule match any of those names.

Players

  1. Press + Add player rule and enter a player name, Riot ID, or Player ID. Separate several names with commas.
  2. Match by chooses how names are compared:
    • Exact Username: the name must match exactly
    • Partial Username: the name only needs to contain what you typed
    • Player ID: match by the player’s internal ID
  3. Where chooses which side of the match the player must be on:
    • Either team
    • Ally (my team)
    • Enemy team
    • Blue team
    • Red team
    • NOT in this match: shows only games without that player
  4. Keep Follow players across name changes on to include games played under a player’s older names. Turn it off to match only the exact names you typed.
  5. Name suggestions show every name a player has used separately, including older names without a tagline.

Champions

  1. Press + Add champion rule and enter one or more champion names, e.g. Ahri, Jinx (means Ahri or Jinx).
  2. Played by chooses who played the champion:
    • I was playing this champion
    • Blue team champion
    • Red team champion
    • Allied team champion
    • Enemy team champion
    • Champion on either team
    • No one (champion NOT in this match)
  3. Add more champion rules to combine requirements, e.g. one rule for your champion and another for the enemy team.

Results and Queues

  1. Results: choose any of Win, Loss, and Other / remake.
  2. Queues: pick the queues to include. Use Select all or Clear all to change them quickly.
  3. Reset all clears every standard filter.

Working With Results

  1. Click a player’s name in a match to show only games with that player. Click the highlighted name again to clear it.
  2. Click a match to open its full stats and timeline in a new tab.
  3. The Match Summary shows win rate, average K / D / A, average kill participation, most played champions, and lane distribution. Switch between All matching games and Displayed games (the current page only).
    • Arena matches and matches without lane data are not counted in lane distribution.
  4. Use First Page, Previous Page, Next Page, and Last Page to move through results, or type a page number and press Go.
  5. Matches per Page can be set from 10 up to 10000. Page sizes marked with ⚠️ (500 or more) can be slow.

AI and Advanced Filtering (Beta)

For anything the standard filters can’t express, switch to AI and Advanced Filtering. Only the visible mode is used: switching modes keeps the other mode’s settings, but they have no effect on results until you switch back.

Generating a Filter With AI

  1. Read the warning in the AI Filter panel. Prompts are logged and stored for quality and safety audits. If you are logged in, your prompts are not used to train the AI provider’s model; if you are not logged in, they may be.
  2. Describe what you want to see, e.g. “games where I got a pentakill”.
  3. Press Agree and Generate Filter. The AI writes a filter and it runs against your matches.
  4. Results are best-effort. Check the matches returned, and rephrase your request if they aren’t what you wanted.
  5. Only requests about filtering your match history will be understood.

Using Your Own AI

  1. Press Copy system instructions to use your own AI.
  2. Paste the instructions into your own AI along with your request.
  3. Paste the AI’s response into the code box and press Run Filter. The page will fill in the right fields automatically.

Writing or Editing Code

The code box is for advanced users. Filters are JavaScript that runs in your own browser (not on rewind.lol’s servers) against your own match data. Do not paste code or prompts from unknown or untrusted sources.

The full reference, including every field and helper, is the same set of system instructions the AI uses: rewind.lol/nlp_code_gen.txt. The rest of this section is a practical summary.

Filter Types

  1. Per-match: write a (match) => boolean function. It is called once for every match in your history, and matches where it returns true are shown.
  2. Cross-match: for filters that compare matches to each other, such as streaks, top 10s, or “the games before X”.
    • Summarize (per match): (match) => summaryObject. Called once for every match. Return a small, flat object. It must include mid: match.mid.
    • Cross-Match Query (across all summaries): (summaries) => an array or Set of mid values to show. summaries is ordered newest first, so use [...summaries].reverse() when you need chronological order.
  3. Order: Newest first keeps the normal history order. Custom sort adds two more fields:
    • Sort Value (per match): (match) => a value to sort by. It must be JSON-safe (numbers, strings, booleans, null, arrays, or plain objects) and no larger than 1 KB.
    • Compare Sort Values: (left, right) => number, like a normal JavaScript sort comparator. It receives only the sort values, not the matches.
    • Sort functions cannot be async. Ties keep the normal newest-first order.
  4. Press Run Filter to apply the code.

The Match Object

Each match describes the game from the profile owner’s point of view. Any field can be missing on older matches, so use optional chaining (?.) and defaults (??).

Field Type Meaning
match.mid number Match ID
match.qid number Queue ID, e.g. 420 ranked solo/duo, 440 ranked flex, 450 ARAM, 1700 and 1710 Arena. See Riot’s queue list
match.win true / false / null Win, loss, or remake/other
match.timestamp number Game end time, in milliseconds since 1970
match.duration number Game length in seconds
match.patch string e.g. "14.3"
match.cid number Your champion ID
match.K, match.D, match.A number Your kills, deaths, and assists
match.kp number / null Your kill participation percent, rounded. null if your team had no kills
match.side string "-1" blue, "1" red, "0" not Summoner’s Rift
match.nsr_side number -1 blue, 1 red, in every mode except Arena (including ARAM). Note this is a number, unlike side
match.ff true / false / null Only set for your losses on Summoner’s Rift and ARAM: true if your team surrendered, otherwise false. null for wins, remakes, and other modes
match.ttmga number Gold difference at the turning point of the game, from your team’s side (sampled once per minute). In a win, it’s the biggest deficit you came back from (0 or negative). In a loss, it’s the biggest lead you lost (0 or positive)
match.ttmga_t string The minute ttmga happened, e.g. "14"
match.teams["-1"], match.teams["1"] array Blue and red team participants

Each participant p in a team has:

Field Type Meaning
p.ign string Name in this match: either "Name" or "Name#TAG"
p.target boolean true for the profile owner
p.cid number Champion ID
p.lane number 1 top, 2 jungle, 3 mid, 4 support, 5 bottom
p.K, p.D, p.A number Kills, deaths, assists
p.cs number Lane and jungle minions killed
p.lv number Champion level
p.fb boolean Got first blood
p.items array 8 item IDs: slots 0-5 inventory, 6 trinket, 7 role quest item (Patch 26.01+)
p.spells array 2 summoner spell IDs
p.multi_kills object Counts keyed "2", "3", "4", "5" (double to penta), and "L" for kills beyond a pentakill

Arena matches (match.mode === "ARENA") are different:

Runes, damage, vision, timelines, and item purchase times are not available.

Helpers

These functions are available in your code. They handle Arena and older data correctly, so prefer them over reading match.teams yourself.

Helper Use
getAllParticipants(match) Every participant in the match, in both normal and Arena matches
fuzzyChampionSearch("kaisa") Champion name to champion ID, tolerating typos and renamed champions
getChampionNameFromId(cid) Champion ID to name
isPlayingChampion(match, cid) You played this champion
teamHasChampion / enemyTeamHasChampion / blueTeamHasChampion / redTeamHasChampion / matchHasChampion (match, cid) Champion is on that team
teamHasPlayer / enemyTeamHasPlayer / blueTeamHasPlayer / redTeamHasPlayer / matchHasPlayer (match, p => ...) Some participant on that team passes your check
isBotParticipant(p) Participant is a bot
parseRiotId(ign) Splits "Name#TAG" into {base, tag}
cleanUsername(name) Lowercases and removes spaces, for comparing names
getPlayerIdentity(p) An ID that stays the same when a player changes their name
player_index_map Every name each player identity has used in your history, for following name changes

Examples

Games where you got a pentakill:

match => {
    const me = getAllParticipants(match).find(p => p.target);
    return (me?.multi_kills?.["5"] ?? 0) > 0;
}

Games longer than 40 minutes on red side, since 2024:

(function () {
    const since = new Date("2024-01-01").getTime();
    return match => match.nsr_side === 1 && match.timestamp >= since && match.duration > 40 * 60;
})()

Games where you had 10+ CS per minute:

match => {
    const me = getAllParticipants(match).find(p => p.target);
    return me?.cs != null && me.cs / (match.duration / 60) >= 10;
}

Wins where you came back from 5,000 or more gold behind:

match => match.win === true && match.ttmga <= -5000

Games against a player, by name (without the tagline):

(function () {
    const wanted = cleanUsername("faker");
    return match => enemyTeamHasPlayer(match, p =>
        !isBotParticipant(p) && cleanUsername(parseRiotId(p.ign).base) === wanted);
})()

Your 10 highest-KDA games, highest first (Cross-match, with Custom sort):

Tips

  1. Do setup once. Your function may run tens of thousands of times. Put expensive work like fuzzyChampionSearch, building a Set, or parsing dates in an outer function, as in the examples above, and return the per-match function from it.
  2. Don’t worry about some matches failing. If your code throws an error on a match, that match is skipped. If it throws on every match, the page reports an error instead.
  3. Pasting AI output. You can paste the whole JSON object an AI writes ({"title": ..., "predicate": ...}) into the code box. The page splits it into the right fields and switches to Cross-match if needed.
  4. Item names. There is no built-in item name lookup. Your code may fetch item data from https://ddragon.leagueoflegends.com/ during setup (the URL must be written out in full; other websites are blocked). See the system instructions for an example.
  5. Debugging. Your code runs in a background worker, so it cannot access the page. console.log output appears in your browser’s developer console. Remove it once your filter works, because it runs once per match.

Saving Filters

  1. Give the filter a Title, then press Save.
  2. Saved filters appear under Saved filters and can be run again or deleted later.
  3. If you’re logged in, filters are saved to your account. Filters saved while logged out stay in that browser; after logging in, use Import into account to move them to your account.
  4. Clear empties the current filter.

Troubleshooting

  1. If the page is slow, use a smaller number of matches per page.
  2. If new matches are missing, update your profile. The history page only shows matches from the most recent profile update.
  3. If you are experiencing a browsing issue, try disabling any ad blockers. See the Errata for other known issues.