# H2hggl — 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.

> Access live e-sports match data, daily schedules, upcoming games, and final results across H2H GG League eBasketball competitions. Retrieve real-time scores, player statistics, head-to-head comparisons, and detailed match timelines.

**Category:** Sports | **Website:** [h2hggl.com/en/ebasketball/schedule](https://h2hggl.com/en/ebasketball/schedule) | **Docs:** [parse.bot/marketplace/c2056cb9-2a9f-41dd-b5cd-79ecc9613bd6/h2hggl-com-api](https://parse.bot/marketplace/c2056cb9-2a9f-41dd-b5cd-79ecc9613bd6/h2hggl-com-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-h2hggl-com-api-c2056cb9/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_h2h

Get head-to-head comparison between two players including career stats for each, recent H2H match results (as win/loss from player_a perspective), and match details. Player names are case-insensitive.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `player_a` | string | Yes | First player name (e.g. SPARKZ). Case-insensitive. |
| `player_b` | string | Yes | Second player name (e.g. SAINT JR). Case-insensitive. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-h2hggl-com-api-c2056cb9/get_h2h \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"player_a":"<string>","player_b":"<string>"}'
```

### get_live_games

Get all currently live and immediately upcoming eBasketball games with real-time scores. Returns games across all active streams.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-h2hggl-com-api-c2056cb9/get_live_games \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_match_details

Get comprehensive match details including box score statistics and play-by-play timeline for a specific match. Stats are available only for completed matches; live/upcoming matches return an empty stats array but may have partial timeline data.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `match_id` | string | Yes | Match external ID from get_schedule or get_live_games (e.g. NB151100626). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-h2hggl-com-api-c2056cb9/get_match_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"match_id":"<string>"}'
```

### get_match_stats

Get box score statistics for a specific match, broken down by quarter and full-time (end-match). Stats include points, field goals, three-pointers, free throws, rebounds, assists, steals, blocks, turnovers, and more. Only available for completed matches (matchStatus=MATCH_ENDED); in-progress or upcoming matches return an empty stats array.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `match_id` | string | Yes | Match external ID from get_schedule or get_live_games (e.g. NB151100626). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-h2hggl-com-api-c2056cb9/get_match_stats \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"match_id":"<string>"}'
```

### get_match_timeline

Get detailed play-by-play timeline for a specific match, including goals, fouls, free throws, and period changes. Each incident has a messageType, time (milliseconds remaining in period), period info, and running score.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `match_id` | string | Yes | Match external ID from get_schedule or get_live_games (e.g. NB151100626). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-h2hggl-com-api-c2056cb9/get_match_timeline \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"match_id":"<string>"}'
```

### get_player_past_games

Get recent past game results for a specific player. Returns the most recent 15 completed games with scores, teams, and opponent info. Player name is case-insensitive.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `player_name` | string | Yes | Player name (e.g. SPARKZ). Case-insensitive. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-h2hggl-com-api-c2056cb9/get_player_past_games \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"player_name":"<string>"}'
```

### get_player_stats

Get detailed statistics and recent game history for a specific player. Returns full career stats and a list of recent completed games. Player name is case-insensitive.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `player_name` | string | Yes | Player name (e.g. SPARKZ, SAINT JR). Case-insensitive. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-h2hggl-com-api-c2056cb9/get_player_stats \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"player_name":"<string>"}'
```

### get_players

Get all eBasketball players with their comprehensive career statistics including averages, totals, win rates, and form. Currently returns ~160 players.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-h2hggl-com-api-c2056cb9/get_players \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_schedule

Get all eBasketball games for a specific date or date range. Returns both upcoming and completed games with scores, teams, and participant info. Each day typically has 100-200 games. Defaults to today (UTC) if no date provided.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | No | Date in YYYY-MM-DD format. Defaults to today (UTC). |
| `days` | integer | No | Number of days to fetch starting from date. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-h2hggl-com-api-c2056cb9/get_schedule \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>","days":"<integer>"}'
```
