Dota 2 API

Games & Comics / API Key Intermediate HTTPS
74 B
Measured Score 0 50 100 Speed 19/30 Consistency 17/20 Security 20/20 Browser access 10/15 Transparency 8/15 TESTED 2026-08-10

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.

JSON Response · Captured
[
  {
    "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.

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

HTTP 404 Requesting a path that does not exist application/json
{
  "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.

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.

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 19/30
Consistency 17/20
Security 20/20
Browser access 10/15
Transparency 8/15
Endpoint Response Time 194ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Games & Comics
Difficulty Intermediate
Endpoint last called: 2026-08-10

Related Tags

Similar APIs

View All →