⚔️ SwordFight API

A static, pre-computed API for turn-based sword fighting games

What is this?

The SwordFight API provides pre-calculated outcomes for every possible move combination in the SwordFight game engine. All outcomes are deterministic and pre-generated as static JSON files.

This API is:

Quick Start

Get all characters:

fetch('https://api.swordfight.me/characters/index.json')
  .then(r => r.json())
  .then(data => console.log(data.characters));

Get a specific character:

fetch('https://api.swordfight.me/characters/human-fighter.json')
  .then(r => r.json())
  .then(character => console.log(character));

Get a round outcome:

fetch('https://api.swordfight.me/rounds/human-fighter/goblin/24/30.json')
  .then(r => r.json())
  .then(outcome => console.log(outcome));

API Endpoints

Character List: GET /characters/index.json
Character Details: GET /characters/{slug}.json
Round Outcome: GET /rounds/{char1}/{char2}/{move1}/{move2}.json

Documentation

📚 Interactive API Documentation - Explore the complete API with Swagger UI

📄 OpenAPI Specification - Download the formal API spec

Resources