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.
Available Data
Example Response
{
"match_id": 4521,
"home_team": "Team A",
"away_team": "Team B",
"score": {
"home": 2,
"away": 1
},
"status": "Full Time",
"date": "2025-01-15",
"league": "Premier League"
} 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
const url = "https://docs.opendota.com/";
// 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.
Common Errors & Troubleshooting
Matrix Score Breakdown
Partially tested on Apr 5, 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.
Fortnite
The Fortnite Tracker API lets you retrieve player statistics, match history, and leaderboard data for Fortnite.