Skip to content

Turbotailz/athena-api

Repository files navigation

Athena API

An open-source API for fetching data about heroes in Overwatch, including data for the Stadium game mode and Player Stats. This project provides a public REST API, a typed NPM client, and the raw dataset.

Features

  • REST API: Hosted on Cloudflare Workers, providing fast access to Hero, Item, Power, and Player Stats data.
  • NPM Package: TypeScript-ready client SDK and types.
  • Images: Hosted portraits and item/power icons.
  • MCP Server: Native support for AI models to query the data.
  • Serverless: Built with Nuxt and Cloudflare Workers.

Public API

Base URL: https://athena-api.pages.dev (Example URL, replace with actual deployment)

Endpoints

  • GET /api/heroes - List all heroes.
    • Query: role (Damage, Tank, Support)
  • GET /api/heroes/:id - Get a specific hero.
    • Query: expand=items,powers (Include full item/power details)
  • GET /api/items - List all items (excluding powers).
    • Query: type, rarity
  • GET /api/items/:id - Get a specific item.
  • GET /api/powers - List all powers (items with rarity "power").
    • Query: type
  • GET /api/powers/:id - Get a specific power.
  • GET /api/players/search - Search for a player profile.
    • Query: name
  • GET /api/players/:id/stats - Get stats for a specific player profile.
  • GET /api/meta - Get API version and stats.

NPM Package Usage

Install the package:

npm install athena-api

Using the Client

import { AthenaClient } from 'athena-api';

const client = new AthenaClient();

// Get all heroes
const heroes = await client.getHeroes();

// Get specific hero with items and powers
const hero = await client.getHero('ana', { items: true, powers: true });

// Get items (regular upgrades)
const items = await client.getItems('survival');

// Get powers (hero-specific abilities)
const powers = await client.getPowers();

MCP Server (for AI)

This package includes a Model Context Protocol (MCP) server.

Run directly:

npx athena-api

Or configure in claude_desktop_config.json:

{
  "mcpServers": {
    "athena": {
      "command": "npx",
      "args": ["-y", "athena-api"]
    }
  }
}

Accessing Raw Data

If you need the full dataset locally (warning: includes all text data):

import { DATA } from 'athena-api/data';

console.log(DATA.heroes);
console.log(DATA.powers);

Development

Prerequisites

  • Node.js (v20+)
  • NPM
  • Wrangler (npm install -g wrangler or use local)

Setup

  1. Clone the repository.
  2. Install dependencies:
    npm install
  3. Place raw JSON files in data/ (heroes.json, items-by-locale.json, etc.).
  4. Build data:
    npm run build-data
    This script processes the JSON files, downloads images, and generates src/data/db.ts.

Run Locally

npm run dev

Build

npm run build

Deployment

This project is configured for Cloudflare Workers.

  1. Login to Cloudflare:
    npx wrangler login
  2. Deploy:
    npm run deploy

The deployment will upload the Worker code and the public/ assets (images).

Project Structure

  • data/: Raw input JSON files.
  • scripts/: Data processing scripts.
  • src/: Source code.
    • index.ts: Worker entry point (API).
    • client.ts: NPM Client SDK.
    • mcp.ts: MCP Server implementation.
    • data/: Generated data files.
  • public/: Static assets (images).

License

ISC

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published