# OpenDota — 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 detailed Dota 2 match statistics, player performance metrics, hero win rates, and professional tournament data to analyze gameplay trends and competitive performance. Search for specific players, explore custom data queries through SQL, and retrieve comprehensive match histories to improve your understanding of the game.

**Category:** Sports | **Website:** [opendota.com/](https://opendota.com/) | **Docs:** [parse.bot/marketplace/88a62cfc-1e6b-47f8-a892-7db7aa7e50bb/opendota-com-api](https://parse.bot/marketplace/88a62cfc-1e6b-47f8-a892-7db7aa7e50bb/opendota-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/opendota/`
**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 explorer

Execute SQL queries against the OpenDota PostgreSQL database. Supports SELECT queries on tables like matches, players, heroes, leagues, and teams. Returns rows as an array of objects plus metadata about the query execution.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `sql` | string | Yes | SQL SELECT query to execute against the OpenDota database. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/opendota/get-explorer \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"sql":"<string>"}'
```

### Get hero stats

Get comprehensive hero performance statistics including pick/win rates across all rank brackets, pro matches, and turbo mode. Returns every hero with base attributes, roles, and aggregate statistics.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/opendota/get-hero-stats \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get match

Retrieve comprehensive match data including duration, scores, players, and advanced statistics for a specific match. Each player entry contains hero, items, kills/deaths/assists, gold/xp rates, benchmarks, and more.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `match_id` | integer | Yes | Numeric match ID to retrieve data for. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/opendota/get-match \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"match_id":"<integer>"}'
```

### Get player

Get player profile data including Steam info, rank tier, and leaderboard position. Returns profile sub-object with Steam details (personaname, avatar, country), rank_tier as an integer encoding medal and star, and leaderboard_rank for top players.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `account_id` | integer | Yes | Steam account ID of the player. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/opendota/get-player \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"account_id":"<integer>"}'
```

### Get player win loss

Get player win/loss count with optional filters for hero, game mode, lobby type, region, patch, and date. Returns aggregate win and lose counts for the filtered set of matches.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `account_id` | integer | Yes | Steam account ID of the player. |
| `date` | integer | No | Number of days to look back from current date. |
| `game_mode` | integer | No | Filter by game mode. |
| `hero_id` | integer | No | Filter by hero ID. |
| `lobby_type` | integer | No | Filter by lobby type. |
| `patch` | integer | No | Filter by patch number. |
| `region` | integer | No | Filter by region. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/opendota/get-player-win-loss \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"account_id":"<integer>","date":"<integer>","game_mode":"<integer>","hero_id":"<integer>","lobby_type":"<integer>","patch":"<integer>","region":"<integer>"}'
```

### Get pro matches

Get recent professional matches ordered by match_id descending. Use less_than_match_id for pagination to retrieve older matches. Each entry includes teams, league, duration, and result.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `less_than_match_id` | integer | No | Get matches with match_id less than this value for pagination. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/opendota/get-pro-matches \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"less_than_match_id":"<integer>"}'
```

### Get pro players

Get list of professional players with their team affiliations and profile details. Returns all registered pro players with Steam info, team name/tag, country, and last match time.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/opendota/get-pro-players \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get team players

Get the list of players who have played for a specific team, including games played, wins, and current membership status. Results are ordered by games_played descending.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `team_id` | integer | Yes | Numeric team ID. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/opendota/get-team-players \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"team_id":"<integer>"}'
```

### Search players

Search for players by personaname. Returns an array of matching player summaries ordered by relevance, each containing account_id, avatar, display name, and last match time.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search query matching player personaname. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/opendota/search-players \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```

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