Dota 2 API

Games & Comics / API Key Intermediate HTTPS
Varies by plan (check documentation)

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

match scores and results
team standings
player statistics
schedule and fixtures

Example Response

JSON 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

429 Too Many Requests You have exceeded the rate limit for unauthenticated requests.
Register at https://www.opendota.com/api-keys for a free API key and include it as ?api_key=YOUR_API_KEY.
404 Not Found The player account ID or match ID does not exist.
Verify the Steam account ID by looking it up on https://www.opendota.com before using it in requests.
null values in response Some match data may not have been parsed yet by OpenDota.
Request parsing via POST /request/{match_id} and wait a few minutes before fetching match data again.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 15/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Games & Comics
Difficulty Intermediate
Verified: 2026-04-04

Similar APIs

View All →