Overview
The Dota 2 API (OpenDota) provides detailed match history, hero statistics, player rankings, and game data for the popular MOBA game Dota 2. You can use it without an API key for basic queries, or register for a free key to unlock higher rate limits. It is a powerful resource for building Dota 2 stats tools and dashboards.
Beginner Tip
Start without an API key to explore public match and hero data. When you need higher request limits, add your key as the api_key query parameter. The /heroes endpoint is a great starting point to understand the data structure.
Measurement Record
What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.
- Request
- GET https://api.opendota.com/api/heroes
- Result
- HTTP 200 · application/json · 21,804 bytes · compressed
- Response time
- 194 ms (median of 3) · fastest 184 ms
- Transport
- TLSv1.3 · TLS_AES_256_GCM_SHA384 · certificate issued by Google Trust Services
- Browser CORS
- Allowed — Access-Control-Allow-Origin: https://apisscore.com
- Served by
- cloudflare
- Recorded
- 2026-08-10
Fields Returned
Top-level fields present in the response we captured, with the type and value we actually received.
| Field | Type | Value received |
|---|---|---|
| id | integer | 1 |
| name | string | npc_dota_hero_antimage |
| localized_name | string | Anti-Mage |
| primary_attr | string | agi |
| attack_type | string | Melee |
| roles | array | [1 item] |
| legs | integer | 2 |
Captured Response
Captured from a real request to https://api.opendota.com/api/heroes on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.
[
{
"id": 1,
"name": "npc_dota_hero_antimage",
"localized_name": "Anti-Mage",
"primary_attr": "agi",
"attack_type": "Melee",
"roles": [
"Carry"
],
"legs": 2
}
] Field Reference
id Unique hero or match identifier. localized_name Display name of the hero (e.g., Anti-Mage). primary_attr Primary attribute of the hero: agi (agility), str (strength), or int (intelligence). attack_type Whether the hero attacks as Melee or Ranged. roles List of roles the hero typically plays, such as Carry, Support, or Initiator. Implementation Example
Calls a real endpoint of this API. Replace any placeholder credentials with your own key.
const url = "https://api.opendota.com/api/heroes";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
headers: {
"X-API-Key": "YOUR_API_KEY"
}
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
How This API Fails
We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.
{
"error": "Not Found"
} Common Errors & Troubleshooting
Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.
Measured Score Breakdown
Live HTTP request to the API endpoint
Fully tested on Aug 10, 2026
Technical Specifications
Related Tags
Similar APIs
View All →Brawl Stars
The Brawl Stars API provides official game data including player profiles, club info, battle logs, and brawler statistics.
Clash of Clans
The Clash of Clans API provides official data on players, clans, clan wars, leagues, and rankings from Supercell's hit mobile strategy game.
Clash Royale
The Clash Royale API offers official data on players, clans, cards, battles, and tournaments from Supercell's card-battle mobile game.
Destiny The Game
The Destiny The Game API (Bungie Platform API) gives developers access to data from the popular Destiny franchise, including player stats, character info, and game content.
Autochess VNG
The Autochess VNG API provides game data for the Autochess VNG mobile game including heroes, items, and races.