{"openapi":"3.1.0","info":{"title":"Avatar WhatsApp RPG — Dragons API","version":"1.0.0","description":"Public read-only API for the Avatar WhatsApp RPG dragon dataset. Returns dragon rank progressions, energy-based movesets, evolution art URLs, and egg relic borrowed ultimates."},"servers":[{"url":"/","description":"Current host"}],"paths":{"/api/public/dragons":{"get":{"summary":"List dragons","description":"Returns dragons with full rank data. All query parameters are optional and combine with AND semantics.","parameters":[{"name":"rank","in":"query","description":"Filter by base rank.","schema":{"type":"string","enum":["D","C","B","A","S"]}},{"name":"element","in":"query","description":"Filter by element (case-insensitive), e.g. fire, water, air.","schema":{"type":"string"}},{"name":"id","in":"query","description":"Filter by numeric dragon id.","schema":{"type":"string"}},{"name":"slug","in":"query","description":"Filter by exact slug, e.g. horlapookie-synx.","schema":{"type":"string"}},{"name":"featured","in":"query","description":"Set to true to return only featured dragons with full evolution art.","schema":{"type":"string","enum":["true"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DragonListResponse"},"examples":{"featured":{"summary":"Featured S-rank dragon","value":{"count":1,"dragons":[{"id":1,"name":"Horlapookie Synx","slug":"horlapookie-synx","element":"air","baseRank":"S","featured":true,"image":"https://example.com/dragons/evolutions/horlapookie-synx-S.png","evolutionImages":{"D":"https://example.com/dragons/evolutions/horlapookie-synx-D.png","C":"https://example.com/dragons/evolutions/horlapookie-synx-C.png","B":"https://example.com/dragons/evolutions/horlapookie-synx-B.png","A":"https://example.com/dragons/evolutions/horlapookie-synx-A.png","S":"https://example.com/dragons/evolutions/horlapookie-synx-S.png"},"egg":{"name":"Skybound Relic","image":"https://example.com/dragons/eggs/horlapookie-synx-egg.png","trigger":"once_per_battle","durationTurns":1,"summary":"Peaks power for one turn and unleashes a borrowed foreign-element ultimate.","borrowedMove":{"slot":8,"name":"Borrowed Inferno","category":"Special","kind":"attack","accuracy":100,"energy":0,"effect":"Deals massive fire damage; ignores defense.","description":"A one-time foreign ultimate unlocked by the egg relic.","damage":{"min":220,"max":260},"foreignElement":"fire"}},"ranks":{"S":{"hp":500,"attack":135,"defense":135,"speed":135,"moves":[{"slot":1,"name":"Gale Slash","category":"Normal","kind":"attack","accuracy":95,"energy":15,"effect":"Standard air strike.","description":"Cuts the target with compressed wind.","damage":{"min":60,"max":80}}]}}}]}}}}}}}}},"/api/public/dragons/{id}/evolution/{rank}":{"get":{"summary":"Get a beast's evolution image","description":"Returns the evolution image for a beast/dragon at a specific rank. By default responds with a 302 redirect to the PNG asset; pass `?format=json` to receive JSON metadata with the absolute image URL. `id` accepts either a numeric id or a slug (e.g. `horlapookie-synx`).","parameters":[{"name":"id","in":"path","required":true,"description":"Beast numeric id or slug.","schema":{"type":"string"},"example":"horlapookie-synx"},{"name":"rank","in":"path","required":true,"description":"Rank tier of the requested evolution.","schema":{"type":"string","enum":["D","C","B","A","S"]},"example":"S"},{"name":"format","in":"query","required":false,"description":"Set to `json` to receive metadata instead of an image redirect.","schema":{"type":"string","enum":["json"]}}],"responses":{"200":{"description":"JSON metadata (only when `?format=json`).","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"slug":{"type":"string"},"name":{"type":"string"},"rank":{"type":"string","enum":["D","C","B","A","S"]},"image":{"type":"string","format":"uri"}},"required":["id","slug","name","rank","image"]},"examples":{"synxS":{"summary":"Synx S-rank evolution","value":{"id":1,"slug":"horlapookie-synx","name":"Horlapookie Synx","rank":"S","image":"https://example.com/dragons/evolutions/horlapookie-synx-S.png"}}}}}},"302":{"description":"Redirect to the PNG evolution asset.","headers":{"Location":{"description":"Absolute URL of the evolution PNG.","schema":{"type":"string","format":"uri"}}}},"400":{"description":"Invalid rank.","content":{"application/json":{"examples":{"invalid":{"value":{"error":"Invalid rank. Use one of D, C, B, A, S."}}}}}},"404":{"description":"Beast not found.","content":{"application/json":{"examples":{"missing":{"value":{"error":"Dragon not found: 9999"}}}}}}}}},"/api/public/dragons/{id}/egg":{"get":{"summary":"Get a beast's egg relic image","description":"Returns the egg relic image for a beast/dragon. By default responds with a 302 redirect to the PNG asset; pass `?format=json` to receive JSON metadata including the borrowed foreign-element ultimate. `id` accepts either a numeric id or a slug.","parameters":[{"name":"id","in":"path","required":true,"description":"Beast numeric id or slug.","schema":{"type":"string"},"example":"1"},{"name":"format","in":"query","required":false,"description":"Set to `json` to receive metadata instead of an image redirect.","schema":{"type":"string","enum":["json"]}}],"responses":{"200":{"description":"JSON metadata (only when `?format=json`).","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"slug":{"type":"string"},"name":{"type":"string"},"egg":{"$ref":"#/components/schemas/EggBoost"}},"required":["id","slug","name","egg"]},"examples":{"synxEgg":{"summary":"Synx egg relic","value":{"id":1,"slug":"horlapookie-synx","name":"Horlapookie Synx","egg":{"name":"Skybound Relic","image":"https://example.com/dragons/eggs/horlapookie-synx-egg.png","trigger":"once_per_battle","durationTurns":1,"summary":"Peaks power for one turn and unleashes a borrowed foreign-element ultimate.","borrowedMove":{"slot":8,"name":"Borrowed Inferno","category":"Special","kind":"attack","accuracy":100,"energy":0,"effect":"Deals massive fire damage; ignores defense.","description":"A one-time foreign ultimate unlocked by the egg relic.","damage":{"min":220,"max":260},"foreignElement":"fire"}}}}}}}},"302":{"description":"Redirect to the PNG egg relic asset.","headers":{"Location":{"description":"Absolute URL of the egg PNG.","schema":{"type":"string","format":"uri"}}}},"404":{"description":"Beast not found or has no egg relic.","content":{"application/json":{"examples":{"missing":{"value":{"error":"Dragon horlapookie-synx has no egg relic."}}}}}}}}},"/api/public/openapi.json":{"get":{"summary":"OpenAPI specification","description":"Returns this OpenAPI 3.1 document.","responses":{"200":{"description":"OpenAPI document","content":{"application/json":{}}}}}}},"components":{"schemas":{"DamageRange":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"}},"required":["min","max"]},"Move":{"type":"object","properties":{"slot":{"type":"integer","minimum":1,"maximum":8},"name":{"type":"string"},"category":{"type":"string","enum":["Normal","Special"]},"kind":{"type":"string","enum":["attack","defense","status","heal","utility"]},"accuracy":{"type":"integer","minimum":0,"maximum":100},"energy":{"type":"integer","minimum":0},"effect":{"type":"string"},"description":{"type":"string"},"damage":{"$ref":"#/components/schemas/DamageRange"},"foreignElement":{"type":"string"}},"required":["slot","name","category","kind","accuracy","energy","effect","description"]},"RankStats":{"type":"object","properties":{"hp":{"type":"integer"},"attack":{"type":"integer"},"defense":{"type":"integer"},"speed":{"type":"integer"},"moves":{"type":"array","items":{"$ref":"#/components/schemas/Move"}}},"required":["hp","attack","defense","speed","moves"]},"EggBoost":{"type":"object","properties":{"name":{"type":"string"},"image":{"type":"string","format":"uri"},"trigger":{"type":"string","enum":["once_per_battle"]},"durationTurns":{"type":"integer"},"summary":{"type":"string"},"borrowedMove":{"$ref":"#/components/schemas/Move"}},"required":["name","image","trigger","durationTurns","summary","borrowedMove"]},"Dragon":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"element":{"type":"string"},"baseRank":{"type":"string","enum":["D","C","B","A","S"]},"featured":{"type":"boolean"},"image":{"type":"string","format":"uri"},"evolutionImages":{"type":"object","additionalProperties":{"type":"string","format":"uri"}},"egg":{"$ref":"#/components/schemas/EggBoost"},"ranks":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/RankStats"}}},"required":["id","name","slug","element","baseRank","image","ranks"]},"DragonListResponse":{"type":"object","properties":{"count":{"type":"integer"},"dragons":{"type":"array","items":{"$ref":"#/components/schemas/Dragon"}}},"required":["count","dragons"]}}}}