Superhero API avatar
Superhero API

Pricing

Pay per usage

Go to Apify Store
Superhero API

Superhero API

Access rich superhero data from Marvel, DC, and more with this Apify actor. Get powers, stats, and bios for developers, games, and apps. Fast, free, and easy to integrate. Ideal for any project needing detailed hero profiles.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Shahid Irfan

Shahid Irfan

Maintained by Community

Actor stats

0

Bookmarked

3

Total users

2

Monthly active users

a day ago

Last modified

Share

Superhero Data Fetcher

Effortlessly retrieve comprehensive superhero profiles, including powerstats, biography, appearance, work details, and connections. This tool supports searching by hero name for multiple results or fetching a single hero by unique ID, making it ideal for building datasets, applications, or analyses related to superhero characters.

🚀 Key Features

  • Flexible Search Options: Search for heroes by name to get multiple matches or retrieve a specific hero using their unique ID.
  • Complete Hero Profiles: Access detailed information such as powerstats (strength, speed, intelligence), biography (real name, publisher, aliases), appearance (height, weight, eye/hair color), work (occupation, base), and connections (teams, affiliations).
  • Structured Data Output: Generates clean, structured JSON data ready for integration into datasets, databases, or applications.
  • Error Handling: Includes built-in retries for transient issues and provides clear error messages for failed requests.
  • Optimized for Performance: Sequential fetching with polite delays to minimize rate limit impacts when retrieving full profiles.

📊 What You Can Fetch

  • Hero Profile: Basic identification, including name and image URL.
  • Powerstats: Quantitative attributes like intelligence, strength, speed, durability, power, and combat skills.
  • Biography: Detailed background information such as full name, publisher, aliases, and first appearance.
  • Appearance: Physical characteristics including height, weight, eye color, hair color, and race.
  • Work: Professional details like occupation and base of operations.
  • Connections: Relationships and affiliations, including group affiliations and relatives.

🔧 Input Configuration

Configure the data fetching process using the following parameters:

ParameterTypeDescriptionDefault
modeselectOperation mode: search (for multiple results) or id (for a single hero).search
searchstringHero name to search for when mode is search.""
hero_idstringUnique hero ID to fetch when mode is id.""
results_wantedintegerMaximum number of search results to retrieve (applicable only in search mode).10
fetch_profilebooleanWhether to fetch full hero profiles for each search result (increases API calls).true

Note: This tool uses an embedded API token for convenience. For production environments, configure the token via environment variables or secrets to enhance security.

📤 Output Data Structure

The output is a collection of JSON objects, each representing a superhero profile. Below is an example of a complete hero item:

{
"id": "123",
"name": "Batman",
"powerstats": {
"intelligence": "100",
"strength": "26",
"speed": "27",
"durability": "50",
"power": "47",
"combat": "100"
},
"biography": {
"full-name": "Bruce Wayne",
"alter-egos": "No alter egos found.",
"aliases": ["Dark Knight", "The Caped Crusader"],
"place-of-birth": "Gotham City",
"first-appearance": "Detective Comics #27",
"publisher": "DC Comics",
"alignment": "good"
},
"appearance": {
"gender": "Male",
"race": "Human",
"height": ["6'2", "188 cm"],
"weight": ["210 lb", "95 kg"],
"eye-color": "Blue",
"hair-color": "Black"
},
"work": {
"occupation": "Businessman",
"base": "Gotham City; Batcave"
},
"connections": {
"group-affiliation": "Batman Family, Justice League, Outsiders",
"relatives": "Martha Wayne (mother, deceased), Thomas Wayne (father, deceased), Damian Wayne (son), Dick Grayson (adopted son), Tim Drake (adopted son), Jason Todd (adopted son), Cassandra Cain (adopted daughter)"
},
"image": "https://www.superherodb.com/pictures2/portraits/10/100/639.jpg",
"source": "superheroapi.com"
}

For search mode with fetch_profile: false, the output may include only basic fields like id, name, and source.

🎯 Usage Examples

Search by Name (Multiple Results)

Retrieve up to 5 heroes matching "Batman":

{
"mode": "search",
"search": "Batman",
"results_wanted": 5,
"fetch_profile": true
}

This returns full profiles for each matching hero. Set fetch_profile to false to get basic information only, reducing the number of API calls.

Fetch Hero by ID (Single Result)

Get the complete profile for hero ID "70":

{
"mode": "id",
"hero_id": "70",
"fetch_profile": true
}

This always fetches the full profile since it's a single request.

⚙️ Configuration Options

  • Mode Selection: Choose search for broad queries or id for precise lookups.
  • Result Limiting: Use results_wanted to control the volume of data fetched in search mode.
  • Profile Depth: Enable fetch_profile for detailed data, but be mindful of API limits.
  • Environment Variables: Set SUPERHERO_TOKEN to override the embedded token for custom or production setups.

📋 Limits & Considerations

  • API Rate Limits: The underlying API has usage limits that vary by plan. Check the official documentation for details.
  • Result Limits: Search mode can return up to the specified results_wanted, but the API may impose its own caps.
  • Data Freshness: Hero data is updated by the provider; refer to their site for the latest information.
  • Error Handling: The tool retries failed requests and logs errors, but persistent issues may require manual intervention.
  • Performance Tips: For large searches, consider disabling fetch_profile or reducing results_wanted to stay within limits.

📈 Use Cases

  • Dataset Creation: Build comprehensive databases of superhero characters for research or entertainment.
  • Application Development: Integrate hero data into apps, games, or educational tools.
  • Analysis and Insights: Analyze powerstats, biographies, or connections for trends and patterns.
  • Content Generation: Use hero profiles to create stories, comparisons, or visualizations.
  • Educational Resources: Develop materials for teaching about fictional characters and their attributes.

🤝 Contributing

Have suggestions or found an issue? Feel free to share feedback or contribute ideas to improve this tool.

📄 License

This project is licensed under the MIT License.


Keywords: superhero data, hero profiles, powerstats, biography, appearance, work, connections, superhero API, hero lookup, superhero dataset, hero search, hero ID, superhero information, comic book data, fictional characters