# OpenDota API

> Returns Dota 2 heroes, hero pick and win statistics, player profiles, professional matches, match details and player match history.

Category: Sports & Gaming. Region: global. 16 endpoints at `https://api.hoshime.com/v1/opendota/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/opendota
## GET /v1/opendota/heroes

All Dota 2 heroes with their primary attribute, attack type and roles.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `attackType` (string), `id` (string), `name` (string), `primaryAttr` (string), `roles` (string[])

```bash
curl "https://api.hoshime.com/v1/opendota/heroes" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/opendota/heroStats

Pick, win and ban counts of every hero in public and professional matches.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `name` (string), `proBan` (integer (int64)), `proPick` (integer (int64)), `proWin` (integer (int64)), `pubPick` (integer (int64)), `pubWin` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/opendota/heroStats" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/opendota/player

A Dota 2 player's profile by account id: name, avatar, rank and MMR estimate.

Scope: `social:read` · Units: 1 · Cached: 30 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `accountId` | integer | yes | Dota 2 account id, the 32-bit id in the player's profile URL. (e.g. 105248644) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `avatarUrl` (string), `bio` (string), `createdAt` (string), `followerCount` (integer (int64)), `followingCount` (integer (int64)), `id` (string), `leaderboardRank` (integer (int64)), `mmrEstimate` (integer (int64)), `name` (string), `postCount` (integer (int64)), `proName` (string), `rankTier` (integer (int64)), `url` (string), `username` (string), `verified` (boolean)

```bash
curl "https://api.hoshime.com/v1/opendota/player?accountId=105248644" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/opendota/proMatches

The most recent professional matches, newest first.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `direName` (string), `direScore` (integer (int64)), `duration` (integer (int64)), `leagueName` (string), `matchId` (string), `radiantName` (string), `radiantScore` (integer (int64)), `radiantWin` (boolean), `startedAt` (string)

```bash
curl "https://api.hoshime.com/v1/opendota/proMatches" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/opendota/match

One Dota 2 match by id: result, duration, score and the ten players with their stats.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `matchId` | integer | yes | Dota 2 match id, such as 7000000000. (e.g. 7000000000) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `cluster` (integer (int64)), `direScore` (integer (int64)), `durationSec` (integer (int64)), `firstBloodSec` (integer (int64)), `gameMode` (integer (int64)), `lobbyType` (integer (int64)), `matchId` (string), `players` (MatchPlayer[]), `players[].accountId` (string), `players[].assists` (integer (int64)), `players[].deaths` (integer (int64)), `players[].denies` (integer (int64)), `players[].goldPerMin` (integer (int64)), `players[].heroDamage` (integer (int64)), `players[].heroId` (string), `players[].kills` (integer (int64)), `players[].lastHits` (integer (int64)), `players[].level` (integer (int64)), `players[].slot` (integer (int64)), `players[].towerDamage` (integer (int64)), `players[].xpPerMin` (integer (int64)), `radiantScore` (integer (int64)), `radiantWin` (boolean), `startedAt` (string)

```bash
curl "https://api.hoshime.com/v1/opendota/match?matchId=7000000000" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/opendota/playerMatches

A player's most recent matches, newest first, up to 100.

Scope: `social:read` · Units: 1 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `accountId` | integer | yes | Dota 2 account id, the 32-bit id in the player's profile URL. (e.g. 105248644) |
| `limit` | integer | no | Items per page, 1 to 100. (default 20) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `assists` (integer (int64)), `averageRank` (integer (int64)), `deaths` (integer (int64)), `durationSec` (integer (int64)), `gameMode` (integer (int64)), `heroId` (string), `kills` (integer (int64)), `lobbyType` (integer (int64)), `matchId` (string), `radiantWin` (boolean), `slot` (integer (int64)), `startedAt` (string)

```bash
curl "https://api.hoshime.com/v1/opendota/playerMatches?accountId=105248644" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/opendota/playerWinLoss

A player's total wins and losses in ranked and unranked Dota 2 matches.

Scope: `social:read` · Units: 1 · Cached: 30 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `accountId` | integer | yes | Dota 2 account id, the 32-bit id in the player's profile URL. (e.g. 105248644) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `losses` (integer (int64)), `wins` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/opendota/playerWinLoss?accountId=105248644" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/opendota/playerHeroes

The heroes a player has played, most played first, with wins and the games played with and against.

Scope: `social:read` · Units: 1 · Cached: 30 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `accountId` | integer | yes | Dota 2 account id, the 32-bit id in the player's profile URL. (e.g. 105248644) |
| `limit` | integer | no | Items per page, 1 to 200. (default 20) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `againstGames` (integer (int64)), `againstWins` (integer (int64)), `games` (integer (int64)), `heroId` (string), `lastPlayedAt` (string), `wins` (integer (int64)), `withGames` (integer (int64)), `withWins` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/opendota/playerHeroes?accountId=105248644" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/opendota/search

Dota 2 players whose name matches the query, with their account id and last match time.

Scope: `social:read` · Units: 1 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Player name to search for, such as miracle. (e.g. miracle) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `avatarUrl` (string), `bio` (string), `createdAt` (string), `followerCount` (integer (int64)), `followingCount` (integer (int64)), `id` (string), `lastMatchAt` (string), `name` (string), `postCount` (integer (int64)), `url` (string), `username` (string), `verified` (boolean)

```bash
curl "https://api.hoshime.com/v1/opendota/search?query=miracle" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/opendota/rankDistribution

How many players of the ranked ladder sit in each rank bin, with the running total.

Scope: `social:read` · Units: 1 · Cached: 360 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `bin` (integer (int64)), `count` (integer (int64)), `cumulativeSum` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/opendota/rankDistribution" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/opendota/teams

Professional Dota 2 teams ranked by OpenDota rating, best first, 1000 per page.

Scope: `social:read` · Units: 1 · Cached: 360 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `lastMatchAt` (string), `logoUrl` (string), `losses` (integer (int64)), `name` (string), `rating` (number (double)), `tag` (string), `wins` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/opendota/teams" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/opendota/liveMatches

Dota 2 matches being played right now that spectators can watch, with their score and average MMR.

Scope: `social:read` · Units: 1 · Cached: 1 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `averageMmr` (integer (int64)), `direScore` (integer (int64)), `direTeam` (string), `gameMode` (integer (int64)), `gameTimeSec` (integer (int64)), `leagueId` (string), `matchId` (string), `radiantLead` (integer (int64)), `radiantScore` (integer (int64)), `radiantTeam` (string), `spectators` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/opendota/liveMatches" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/opendota/publicMatches

The 100 most recent public Dota 2 matches with their lobby, rank and the heroes of both teams.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `averageRank` (integer (int64)), `direHeroIds` (string[]), `durationSec` (integer (int64)), `gameMode` (integer (int64)), `matchId` (string), `radiantHeroIds` (string[]), `radiantWin` (boolean), `startedAt` (string)

```bash
curl "https://api.hoshime.com/v1/opendota/publicMatches" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/opendota/playerTotals

A player's career totals and per-game averages for each stat, such as kills, deaths and gold per minute.

Scope: `social:read` · Units: 1 · Cached: 30 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `accountId` | integer | yes | Dota 2 account id, the 32-bit id in the player's profile URL. (e.g. 70388657) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `average` (number (double)), `games` (integer (int64)), `stat` (string), `total` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/opendota/playerTotals?accountId=70388657" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/opendota/playerPeers

The players a player has most often played with or against, most games first, up to 200.

Scope: `social:read` · Units: 1 · Cached: 30 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `accountId` | integer | yes | Dota 2 account id, the 32-bit id in the player's profile URL. (e.g. 70388657) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `againstGames` (integer (int64)), `againstWins` (integer (int64)), `avatarUrl` (string), `bio` (string), `createdAt` (string), `followerCount` (integer (int64)), `followingCount` (integer (int64)), `games` (integer (int64)), `id` (string), `lastPlayedAt` (string), `name` (string), `postCount` (integer (int64)), `url` (string), `username` (string), `verified` (boolean), `wins` (integer (int64)), `withGames` (integer (int64)), `withWins` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/opendota/playerPeers?accountId=70388657" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/opendota/heroMatchups

How often one hero won against each other hero in public matches: games played and wins per opposing hero.

Scope: `social:read` · Units: 1 · Cached: 360 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `heroId` | integer | yes | Dota 2 hero id, such as 1 for Anti-Mage. The heroes endpoint lists them. (e.g. 1) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `games` (integer (int64)), `opponentHeroId` (string), `wins` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/opendota/heroMatchups?heroId=1" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
