# H2hggl — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.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 for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/h2hggl/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## 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.beta.paywithlocus.com/api/wrapped/credits/h2hggl/get-h2h \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/h2hggl/get-live-games \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/h2hggl/get-match-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/h2hggl/get-match-stats \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/h2hggl/get-match-timeline \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/h2hggl/get-player-past-games \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/h2hggl/get-player-stats \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/h2hggl/get-players \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/h2hggl/get-schedule \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>","days":"<integer>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.