This document describes the main API for the Wild Rift Champions API library.
interface ChampionHeader {
id: string;
name: string;
image_url: string;
}Basic champion info.
interface Ability {
name: string;
icon_url: string;
video_url: string;
description: string;
ability_type: AbilityType;
}Represents a champion's ability.
interface Skin {
name: string;
image_url: string;
}Represents a champion skin.
interface Champion extends ChampionHeader {
role: string;
skins: Skin[];
intro_video_url: string;
difficulty: number;
abilities: Record<AbilityType, Ability>;
}Full champion details.
fetchChampionHeaders(): Promise<ChampionHeader[]>Fetches all champion headers (basic info).
fetchChampion(champion: ChampionHeader): Promise<Champion>Fetches full champion details from a given header.
Throws:
Errorif a network or parsing error occurs.
import { fetchChampionHeaders, fetchChampion } from "wildrift-champions-api";
async function example() {
const headers = await fetchChampionHeaders();
const ahriHeader = headers.find((c) => c.id === "ahri");
if (ahriHeader) {
const ahri = await fetchChampion(ahriHeader);
console.log(ahri.name, ahri.role, ahri.abilities);
}
}- All fetch functions throw an
Errorif a network or parsing error occurs. - Use
try/catchto handle errors gracefully.