badgeAPI/README.md
2025-04-19 11:58:49 -04:00

2 KiB

Badge Aggregator API

A fast Discord badge aggregation API built with Bun and Redis caching.

Features

  • Aggregates custom badge data from multiple sources (e.g. Vencord, Nekocord, Equicord, etc.)
  • Optional caching via Redis (1 hour per user-service combo)
  • Supports query options for service filtering, separated output, and cache bypass
  • Written in TypeScript with formatting and linting using BiomeJS

Requirements

Environment

Copy the .env.example file in the root:

cp .env.example .env

Then edit the .env file as needed:

# NODE_ENV is optional and can be used for conditional logic
NODE_ENV=development

# The server will bind to this host and port
HOST=0.0.0.0
PORT=8080

# Redis connection URL, password isn't required
REDIS_URL=redis://username:password@localhost:6379

# Value is in seconds
REDIS_TTL=3600

Endpoint

GET /:userId

Path Parameters

Name Description
userId Discord User ID to query

Query Parameters

Name Description
services A comma or space separated list of services to fetch badges from
cache Set to true or false (default: true). false bypasses Redis
seperated Set to true to return results grouped by service, else merged array

Supported Services

  • Vencord
  • Equicord
  • Nekocord
  • ReviewDb

Example

GET /209830981060788225?seperated=true&cache=true&services=equicord

Development

Run formatting and linting with BiomeJS:

bun run lint
bun run lint:fix

Start the Server

bun run start

License

MIT