# OP.GG — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Look up detailed League of Legends and TFT player statistics, match history, and champion performance data to analyze gameplay and track competitive standings. Search summoner profiles, review leaderboards, and monitor how specific champions perform across different skill levels.

**Category:** Sports | **Website:** [op.gg/](https://op.gg/) | **Docs:** [parse.bot/marketplace/af8d3064-7b2a-4b73-93cf-25db02b06646/op-gg-api](https://parse.bot/marketplace/af8d3064-7b2a-4b73-93cf-25db02b06646/op-gg-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-op-gg-api-af8d3064/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_champion_build

Get recommended builds for a champion including runes, items, skill order, and summoner spells with pick rates and win rates. Returns the most popular and highest win rate build paths for the specified position and rank tier.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `champion` | string | Yes | Champion name in lowercase without spaces or apostrophes (e.g., ahri, jinx, leesin, drmundo) |
| `position` | string | No | Lane position filter |
| `region` | string | No | Region filter |
| `tier` | string | No | Rank tier filter |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-op-gg-api-af8d3064/get_champion_build \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"champion":"<string>","position":"<string>","region":"<string>","tier":"<string>"}'
```

### get_leaderboard

Get the ranked leaderboard for a region and tier. Returns up to 100 summoner names and tags for the top players in that tier.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `region` | string | No | Region code |
| `tier` | string | No | Leaderboard tier |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-op-gg-api-af8d3064/get_leaderboard \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"region":"<string>","tier":"<string>"}'
```

### get_summoner_champion_stats

Get champion statistics for a summoner in the current ranked season: win rates, KDA, CS, and games played per champion. Returns empty array for summoners without ranked games this season.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | string | Yes | Summoner game name |
| `region` | string | No | Region code |
| `tag` | string | Yes | Summoner tagline |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-op-gg-api-af8d3064/get_summoner_champion_stats \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"<string>","region":"<string>","tag":"<string>"}'
```

### get_summoner_mastery

Get champion mastery data for a summoner: mastery levels, points, grades, and last played timestamps for every champion they have mastery on.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | string | Yes | Summoner game name |
| `region` | string | No | Region code |
| `tag` | string | Yes | Summoner tagline |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-op-gg-api-af8d3064/get_summoner_mastery \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"<string>","region":"<string>","tag":"<string>"}'
```

### get_summoner_match_history

Get match history for a summoner. Returns up to 20 recent matches with champion, KDA, items, runes, team compositions, and performance metrics. Use ended_at cursor for pagination through older games. Returns empty array if summoner has no recent games of the specified type.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `champion` | string | No | Filter by champion name (empty string for all champions) |
| `ended_at` | string | No | Pagination cursor - ISO timestamp of the last game's created_at to load older games |
| `game_type` | string | No | Game type filter |
| `name` | string | Yes | Summoner game name |
| `region` | string | No | Region code |
| `tag` | string | Yes | Summoner tagline |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-op-gg-api-af8d3064/get_summoner_match_history \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"champion":"<string>","ended_at":"<string>","game_type":"<string>","name":"<string>","region":"<string>","tag":"<string>"}'
```

### get_summoner_profile

Get a summoner's profile including level, rank summary, win/loss record, and top champions summary. Requires the exact game name and tagline (case-insensitive). Returns null for optional fields when data is unavailable.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | string | Yes | Summoner game name |
| `region` | string | No | Region code |
| `tag` | string | Yes | Summoner tagline (e.g., KR1, NA1, 1God) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-op-gg-api-af8d3064/get_summoner_profile \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"<string>","region":"<string>","tag":"<string>"}'
```

### get_summoner_ranked_stats

Get ranked statistics for a summoner. Returns the same profile shape as get_summoner_profile: rank, win/loss record, level, and top champions.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | string | Yes | Summoner game name |
| `region` | string | No | Region code |
| `tag` | string | Yes | Summoner tagline |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-op-gg-api-af8d3064/get_summoner_ranked_stats \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"<string>","region":"<string>","tag":"<string>"}'
```

### get_summoner_season_history

Get historical season IDs for a summoner. Returns seasons the summoner has data for, ordered most recent to oldest.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | string | Yes | Summoner game name |
| `region` | string | No | Region code |
| `tag` | string | Yes | Summoner tagline |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-op-gg-api-af8d3064/get_summoner_season_history \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"<string>","region":"<string>","tag":"<string>"}'
```

### search_summoner

Full-text search for summoners by name and region. Returns matching summoner profiles with game name, tagline, rank, and thumbnail. Results are not paginated; server returns all matches.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword (summoner name or partial name) |
| `region` | string | No | Region code |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-op-gg-api-af8d3064/search_summoner \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>","region":"<string>"}'
```
