MarvelRivalsAPI.com
Swagger DocsDiscord
  • Introduction
    • Documentation Overview
  • Errors
  • Rate Limits
  • Endpoints
    • Achievements
      • All Achievements
      • Achievement
    • Battlepass
    • Heroes
      • All Heroes
      • Hero
      • Hero Stats
      • Hero Leaderboard
      • Costumes
        • All Costumes
        • Costume
    • Items
      • All Items
      • Item
    • Maps
      • All Maps
    • Patch Notes
      • All Balances
        • Balance
      • All Dev Diaries
        • Dev Diray
      • All Patch Notes
        • Patch Note
      • Game Versions
      • Seasons
    • Player Stats
      • Find Player
      • Player
      • Update Player
    • Match Stats
      • Match History v1
      • Match
      • Match History v2
Powered by GitBook
On this page

Was this helpful?

  1. Endpoints
  2. Heroes

Hero Stats

GET https://marvelrivalsapi.com/api/v1/heroes/hero/:query/stats

This endpoint retrieves detailed statistics for a specific hero based on their name or ID. The stats are fetched from an external API, and the response includes processed hero stats for analysis and display.

Headers

Name
Value

Content-Type

application/json

x-api-key*

YOUR API KEY

Query Parameters

Name
Type
Required
Description

query*

string

✔️

The name or ID of the hero to retrieve.

Example Requests

curl -X GET "https://marvelrivalsapi.com/api/v1/heroes/hero/squirrel girl/stats"
     -H "x-api-key: YOUR_API_KEY"
const axios = require("axios");

try {
    const response = await axios.get("https://marvelrivalsapi.com/api/v1/heroes/hero/squirrel girl/stats", {
        headers: {
            "x-api-key": "YOUR_API_KEY"
        }
    });
    console.log(response.data);
} catch (error) {
    console.error("Error fetching balances:", error.response ? error.response.data : error.message);
}
import requests

url = "https://marvelrivalsapi.com/api/v1/heroes/hero/squirrel girl/stats"
headers = {
    "x-api-key": "YOUR_API_KEY"
}

response = requests.get(url, headers=headers)

if response.status_code == 200:
    print(response.json())
else:
    print(f"Error {response.status_code}: {response.text}")
import java.net.http.*;
import java.net.URI;
import java.io.IOException;

public class ApiClient {
    public static void main(String[] args) {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://marvelrivalsapi.com/api/v1/heroes/hero/squirrel girl/stats"))
            .header("x-api-key", "YOUR_API_KEY")
            .GET()
            .build();

        try {
            HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
            System.out.println(response.body());
        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
        }
    }
}

Response

{
    "hero_id": 1032,
    "hero_name": "squirrel girl",
    "hero_icon": "/heroes/transformations/squirrel-girl-headbig-0.webp",
    "matches": 2869,
    "wins": 1200,
    "k": 16.011153712094806,
    "d": 5.729522481700941,
    "a": 5.261763680724991,
    "play_time": "419h 26m 58s",
    "total_hero_damage": 49908207.01649284,
    "total_hero_heal": 0,
    "total_damage_taken": 18015524.1030235,
    "session_hit_rate": 0.37304336259854143,
    "solo_kill": 2.12373649355176
}
{
  "error": true,
  "message": "Invalid hero name or ID. The provided name or ID does not match any known hero.",
  "status": 400
}
{
  "error": true,
  "message": "Invalid or missing API key.",
  "status": 401
}
{
  "error": true,
  "message": "Hero stats not found. No stats data could be retrieved for the given hero.",
  "status": 404
}
{
  "error": true,
  "message": "An error occurred while fetching data.",
  "status": 500
}

Response Field Descriptions

Field
Type
Description

hero_id

Number

Unique identifier for the hero.

hero_name

String

Display name of the hero.

hero_icon

String

Path or URL to the hero's icon image.

matches

Number

Total number of matches the hero has been played in.

wins

Number

Total number of matches won with this hero.

k

Number

Average kills per match.

d

Number

Average deaths per match.

a

Number

Average assists per match.

play_time

String

Total play time with this hero (formatted as hours, minutes, and seconds).

total_hero_damage

Number

Total damage dealt to enemy heroes.

total_hero_heal

Number

Total healing done by this hero.

total_damage_taken

Number

Total damage taken while playing this hero.

session_hit_rate

Number

Hit rate during sessions, usually a value between 0 and 1.

solo_kill

Number

Average number of solo kills per match.

PreviousHeroNextHero Leaderboard

Last updated 2 months ago

Was this helpful?