Utils API Server

A comprehensive utility API server with powerful avatar generation, supporting REST and GraphQL

📖 API Documentation🚀 GraphQL Playground✅ Health Check

🖼️ Avatar API Playground

Generate beautiful avatars with multiple strategies: third-party services, local algorithms, or smart auto-selection with fallbacks.

Customize Your Avatar

/api/avatar?seed=demo-user&strategy=auto&size=128&colors=bright

Live Preview

Avatar Preview

Updates automatically as you change settings

🎯 Avatar Generation Strategies

🎯 Auto Strategy

Smart fallback system that tries services → local → algorithms for best results.

🌐 Third-Party Services

High-quality avatars from Gravatar, RoboHash, DiceBear, Boring Avatars & UI Avatars.

📁 Local Generation

Four local generation methods: Static files, Enhanced templates, AI personas, and Database collections.

⚡ Local Algorithms

Fast, consistent avatars generated locally: Identicon, Blockies, and Gradient styles.

⚡ Quick Examples

Email-based avatar

Email-based avatar

Geometric identicon

Geometric identicon

UI Avatars style

UI Avatars style

Enhanced template

Enhanced template

AI-driven persona

AI-driven persona

Pastel gradient

Pastel gradient

Dark pixel art

Dark pixel art

Robot avatar

Robot avatar

📝 API Usage Examples

GET Request (Direct Image)

# Basic usage
GET /api/avatar?seed=user@example.com

# With specific strategy and options
GET /api/avatar?seed=john.doe&strategy=algorithm&type=identicon&size=128&colors=bright

# Using service provider
GET /api/avatar?seed=alice&strategy=service&serviceType=uiavatars&size=64

# Using local generation types
GET /api/avatar?seed=persona&strategy=local&localType=ai&size=128

POST Request (JSON Response)

POST /api/avatar
Content-Type: application/json

{
  "seed": "user@example.com",
  "strategy": "local",
  "localType": "ai",
  "cat": "professional",
  "colorScheme": "pastel",
  "size": 128,
  "format": "svg"
}

JavaScript Integration

// Simple image element
const avatarUrl = '/api/avatar?seed=' + encodeURIComponent(userEmail);
const img = document.createElement('img');
img.src = avatarUrl;
img.alt = 'User Avatar';

// React component
function UserAvatar({ email, size = 64 }) {
  const avatarUrl = `/api/avatar?seed=${encodeURIComponent(email)}&size=${size}`;
  return <img src={avatarUrl} alt="Avatar" width={size} height={size} />;
}

🛠️ Other Utilities

📝 Text Processing

Calculate text statistics, word counts, character analysis

/api/utils/text-length

🔗 URL Processing

Parse URLs, extract components, validate domains

/api/utils/url-parse

📅 Date Formatting

Format dates, timezone conversion, relative time

/api/utils/date-format

🚀 Key Features

Fast & Reliable

Optimized for performance with smart caching

🔄

Smart Fallbacks

Automatic fallback between strategies

🎨

Multiple Styles

5+ avatar providers, 4 local types, and 3 algorithms

🔧

Highly Configurable

Extensive customization options

📱

REST & GraphQL

Support for multiple API paradigms

🛡️

Type Safe

Full TypeScript support and validation