Mack's LoL Scout
Step 01

Download champion data (static)

Fetch champion metadata once (basic + detailed), save it locally, and build a friendly lookup.

Run

Run after each small change. Tiny loops win.

uv run python -m src.scout
You will touch
  • src/scout/ (your fetch code)
  • data/ddragon/
Time

30–60 minutes

Do this (suggested order)

  1. Install the HTTP library: uv add requests.
  2. Fetch the Data Dragon versions list and pick the newest version string.
  3. Download champion.json for that version (and a language like en_US).
  4. Download championFull.json for the same version/lang (this has spells, tags, lore, etc.).
  5. Save them to data/ddragon/champion.json and data/ddragon/champion_full.json.
  6. Build a small lookup file (whatever mapping you like) and save data/ddragon/champ_lookup.json.

You’ll practice

  • Install a lib with uv
  • Make HTTP requests with requests
  • Save + load JSON cleanly

Explainers (for context, not homework)

Build

Dependency
  • requests
Data Dragon grab
  • Download champion.json (basic) for a chosen version/lang
  • Download championFull.json (detailed) for the same version/lang
  • Save both under data/ddragon/
Lookup helper
  • Build champ_lookup.json (key→name mapping you like)

Check yourself

  • Script prints how many champions loaded (basic + detailed)
  • Shows three example mappings like “266 -> Aatrox”

If it breaks

  • Forgetting to create data/ddragon/
  • Writing Python dict repr instead of JSON
  • Using the wrong ddragon endpoint

Hints (spoilers)

Hint: versions endpoint (grab it, don’t guess it)

Data Dragon has a “versions” endpoint that returns a list. Pick the first entry (newest) and use it for the champion file URL.

Receipt prints that prevent guessing

print('VERSIONS URL:', url)
r = requests.get(url)
print('STATUS:', r.status_code)
versions = r.json()
print('NEWEST:', versions[0])
Bigger hint: URL shape (print it before you fetch it)

The champion list URL looks like: ddragon.leagueoflegends.com/cdn/<version>/data/<lang>/champion.json. If you can print the exact URL, you can fix 90% of bugs.

URL you’re aiming for

https://ddragon.leagueoflegends.com/cdn/<version>/data/<lang>/champion.json

The “all champs, but detailed” version is the same URL shape with a different filename:

Detailed file URL

https://ddragon.leagueoflegends.com/cdn/<version>/data/<lang>/championFull.json
Unblock-me: “I saved it but it looks weird” (JSON vs Python repr)

If your file contains single quotes or looks like {'key': 'value'}, you accidentally wrote the Python representation, not real JSON.

The save/load pattern (the safe one)

import json

with open('data/ddragon/champion.json', 'w', encoding='utf-8') as f:
  json.dump(data, f, indent=2)

with open('data/ddragon/champion.json', 'r', encoding='utf-8') as f:
  data = json.load(f)
Unblock-me: docs rabbit hole guardrail

Riot docs → League of Legends → Data Dragon. Find “versions” and “champion.json”. Don’t go down the per-champion JSON rabbit hole yet. You only need champion.json and championFull.json right now.

Dependency

Just this one for now. Keep the backpack light.

uv add requests

Expected files

data/
  ddragon/
    champion.json
    champion_full.json
    champ_lookup.json

URL shape you’re aiming for

https://ddragon.leagueoflegends.com/cdn/<version>/data/<lang>/champion.json

URL shape (detailed)

https://ddragon.leagueoflegends.com/cdn/<version>/data/<lang>/championFull.json
Example printout vibe

“Loaded 168 champions. 266 → Aatrox | 412 → Thresh | 875 → Sett”.