API Documentation
Build with
Mythological Power
Comprehensive documentation for accessing the Greek Mythology API. Learn how to integrate ancient tales into your modern applications.
Base URL
Base URL
https://thegreekmythapi.vercel.app/apiImages are available at /api/{category}/{name}.png, for example:
Image URL Example
https://thegreekmythapi.vercel.app/api/heroes/orpheus.pngAvailable Endpoints
/gods– Olympian deities and divine beings/heroes– Legendary warriors and champions/monsters– Fearsome creatures and beasts/titans– Primordial gods and giants
Example: Get All Gods
Request
GET
/api/gods
GET https://thegreekmythapi.vercel.app/api/heroesResponse
200 OK
{
"name": "Orpheus",
"description": "Legendary musician, poet, and prophet in the Greek myths. Son of Apollo.",
"category": "Hero",
"attributes": {
"origin": "Son of Apollo and the muse Calliope",
"symbols": [
"Lyre",
"Orphic tablets"
],
"abode": "Various, including the underworld",
"powers": [
"Musical prowess",
"Journey to the underworld"
],
"family": {
"parents": [
"Apollo",
"Calliope"
],
"siblings": [
"Linus",
"Aglaea",
"Eupheme"
],
"spouse": [
"Eurydice"
]
},
"stories": [
"Rescue of Eurydice from the underworld",
"Death at the hands of Maenads"
]
},
"image": "/api/heroes/orpheus.png",
"id": 1
},
Example: Zeus Image
Each entity comes with a high-quality AI-generated image, accessible via the image URL in the response.
.png&w=1920&q=75)
Example: Hercules Image
Images can be used to enhance your applications with rich visual content.
API Tips & Tricks
Filtering Related Entities
You can cross-reference entities using their relationships. For example, to find all heroes related to Zeus:
Example Code
// First get Zeus's details
const zeus = await fetch('https://thegreekmythapi.vercel.app/api/gods')
.then(r => r.json())
.then(gods => gods.find(g => g.name === 'Zeus'));
// Then get all heroes
const heroes = await fetch('https://thegreekmythapi.vercel.app/api/heroes')
.then(r => r.json());
// Filter heroes related to Zeus
const zeusHeroes = heroes.filter(hero =>
hero.attributes.family?.parents?.includes('Zeus') ||
hero.attributes.stories?.some(story =>
story.includes('Zeus')
)
);Combining Multiple Endpoints
Create rich storytelling by combining data from different endpoints:
// Fetch data from all endpoints in parallel
const [gods, heroes, monsters] = await Promise.all([
fetch('https://thegreekmythapi.vercel.app/api/gods')
.then(r => r.json()),
fetch('https://thegreekmythapi.vercel.app/api/heroes')
.then(r => r.json()),
fetch('https://thegreekmythapi.vercel.app/api/monsters')
.then(r => r.json())
]);
// Find all entities involved in a specific story
const trojanWar = [...gods, ...heroes, ...monsters]
.filter(entity =>
entity.attributes.stories?.some(story =>
story.toLowerCase().includes('troy') ||
story.toLowerCase().includes('trojan')
)
);Building Family Trees
Create genealogical relationships between gods and heroes:
// Get all gods and heroes
const [gods, heroes] = await Promise.all([
fetch('https://thegreekmythapi.vercel.app/api/gods')
.then(r => r.json()),
fetch('https://thegreekmythapi.vercel.app/api/heroes')
.then(r => r.json())
]);
// Function to find children of a deity
const findChildren = (deityName) => {
return [...gods, ...heroes]
.filter(entity =>
entity.attributes.family?.parents?.includes(deityName)
);
};
// Example: Get Zeus's family tree
const zeusFamily = {
deity: gods.find(g => g.name === 'Zeus'),
spouse: gods.find(g => g.name === 'Hera'),
children: findChildren('Zeus'),
siblings: gods.filter(g =>
g.attributes.family?.parents?.includes('Cronus') &&
g.name !== 'Zeus'
)
};Other Endpoints
/heroes– GET all heroesRequestGET/api/heroesGET https://thegreekmythapi.vercel.app/api/heroes/monsters– GET all monstersRequestGET/api/monstersGET https://thegreekmythapi.vercel.app/api/monsters/titans– GET all titansRequestGET/api/titansGET https://thegreekmythapi.vercel.app/api/titans
Usage
No authentication required. Simply send a GET request to any endpoint. Example using fetch in JavaScript:
JavaScript Example
fetch('https://thegreekmythapi.vercel.app/api/gods')
.then(res => res.json())
.then(data => console.log(data))