Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Shineii86/AniQuotesAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

164 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Note

This project has been archived and is no longer actively maintained.

After 10 months of development as a solo project, this repository is being archived due to limited community support and the unsustainable workload of maintaining multilingual quote data as a single developer. The API may continue to work as long as the Vercel deployment remains active, but no new features, bug fixes, or quote additions will be made.

Thank you to everyone who starred, forked, or used the API. Feel free to fork and continue development on your own.


💬 AniQuotesAPI

Free Multilingual Anime Quotes API with Image Generation

Vercel Version Node License Languages Status

API Status Last Commit Repo Size Stars Forks

A free, serverless API delivering anime quotes in 10 languages with auto-translation, beautiful image generation, full-text search, and external provider aggregation.


🚀 Quick Start · 📡 API Docs · 🖼️ Image Generator · 🌍 Languages · 🤝 Contributing


📊 At a Glance

📡 800+ Quotes
Curated collection
Community-driven
Always growing
⚡ 7 Endpoints
Random · Anime · Character
Search · Languages
Image · Status
🌍 10 Languages
EN · JP · KO · ZH · HI
ES · FR · DE · PT · RU · IT
Auto-translated via LibreTranslate
🖼️ Image Gen
Beautiful PNG cards
18 gradient themes
Custom fonts & watermarks

✨ Features

⚡ Core

  • Random, Anime, Character endpoints with pagination
  • Full-text search across quotes, anime, and characters (/v1/search)
  • External provider aggregation — Animechan API + local data with deduplication
  • Smart caching — in-memory TTL cache for all external API calls
  • Graceful fallback — local data when providers are unavailable

🌍 Multilingual

  • Auto-translation via LibreTranslate (free, open-source)
  • 10 supported languages — EN, JP, KO, ZH, HI, ES, FR, DE, PT, RU, IT
  • Pre-translated local data used when available, auto-translate as fallback
  • 24-hour translation cache to avoid redundant API calls
  • Self-hosted LibreTranslate support via environment variables

🖼️ Image Generation

  • Beautiful PNG quote cards with gradient backgrounds
  • 18 curated gradient themes — warm, vibrant, anime-inspired
  • Auto-sizing fonts — shrinks for long quotes, expands for short ones
  • Glass card overlay with rounded corners and drop shadow
  • Watermark bar with API attribution

🚀 Deployment

  • Zero-config Vercel deployment
  • Serverless functions — scales automatically
  • CORS enabled — works from any frontend
  • ~50KB total codebase, no heavy dependencies
  • Free forever — no API keys required for basic usage

🗞️ Data Sources

Source Type Description
Local Database JSON 800+ curated English quotes with 10 language translations
Animechan API External Community anime quotes — aggregated with 1-hour caching

External providers are tried first; local data is the fallback. Results are deduplicated by quote text.


🏗️ Architecture

Request Flow

Stage Component Description
1 Client Browser, app, or curl sends request
2 Vercel Edge Routes request, applies CORS headers
3 Cache Check In-memory TTL cache — hit = instant response
4 Provider Manager Tries Animechan API, merges with local data
5 Deduplicate Removes duplicate quotes across sources
6 Translate Auto-translates if non-English requested and no local translation
7 Respond Paginate, format → JSON / PNG image

Modules

Module File Purpose
Provider Manager utils/providers/index.js Aggregates all quote sources
Animechan Provider utils/providers/animechan.js Fetches from Animechan API
Translator utils/translator.js LibreTranslate auto-translation
Cache utils/cache.js In-memory TTL response cache
Image Generator utils/imageGenerator.js Canvas-based PNG generation
Config utils/config.js Shared metadata and buildMeta()
Helpers utils/helpers.js Data loading, filtering, pagination
Stats utils/stats.js Quote statistics generator

📡 API Endpoints

GET /v1/random

Returns a random anime quote from local data or external providers.

curl "https://aniquotesapi.vercel.app/v1/random"
📄 Example Response
{
  "status": "success",
  "data": {
    "id": 42,
    "quote": "People's dreams... have no ends!",
    "anime": "One Piece",
    "character": "Marshall D. Teach",
    "language": "en",
    "source": "local"
  },
  "meta": {
    "creator": "Shinei Nouzen",
    "github": "https://github.com/Shineii86",
    "timestamp": "2026-05-08T07:00:00.000Z"
  }
}

GET /v1/anime

Get quotes from a specific anime. Merges results from external providers and local data.

Param Type Default Description
name string Anime name (required)
limit 1-20 3 Max quotes to return
offset ≥0 0 Pagination offset
curl "https://aniquotesapi.vercel.app/v1/anime?name=naruto&limit=5"

GET /v1/character

Get quotes said by a specific character across all sources.

Param Type Default Description
name string Character name (required)
limit 1-20 3 Max quotes to return
offset ≥0 0 Pagination offset
curl "https://aniquotesapi.vercel.app/v1/character?name=goku"

GET /v1/search

Full-text search across all quotes by text, anime name, or character name.

Param Type Default Description
q string Search query (required)
limit 1-20 5 Max results
offset ≥0 0 Pagination offset
curl "https://aniquotesapi.vercel.app/v1/search?q=believe+in+yourself"

GET /v2/languages

Get quotes in any supported language. Uses pre-translated data when available, auto-translates via LibreTranslate otherwise.

Param Type Default Description
lang string Language code (required)
anime string Filter by anime name
character string Filter by character name
limit 1-20 3 Max quotes
offset ≥0 0 Pagination offset
curl "https://aniquotesapi.vercel.app/v2/languages?lang=jp&anime=naruto"
curl "https://aniquotesapi.vercel.app/v2/languages?lang=es&limit=10"

GET /v2/image

Generate a beautiful PNG image with quote text. Supports three modes.

Param Description
id Quote ID (local data mode)
quote + anime + character Inline quote data mode
(none) Random quote image mode
lang Language code (default: en)
# By local ID
curl "https://aniquotesapi.vercel.app/v2/image?id=1" -o quote.png

# Inline quote data
curl "https://aniquotesapi.vercel.app/v2/image?quote=Believe+it&anime=Naruto&character=Naruto" -o quote.png

# Random quote image
curl "https://aniquotesapi.vercel.app/v2/image" -o random.png

GET /status

API health check, quote statistics, supported languages, and active providers.

curl "https://aniquotesapi.vercel.app/status"
📄 Example Response
{
  "api": "AniQuotes API",
  "version": "3.0.0",
  "status": "alive",
  "health": { "status": "operational", "uptime": 12345.678, "node": "v20.x" },
  "stats": {
    "totalQuotes": 800,
    "quotesByLanguage": { "en": 800, "jp": 800, "es": 800 },
    "supportedLanguages": ["en", "jp", "ko", "zh", "hi", "es", "fr", "de", "pt", "ru", "it"]
  },
  "providers": [{ "name": "animechan", "type": "external" }],
  "features": {
    "externalProviders": true,
    "autoTranslation": true,
    "imageGeneration": true,
    "pagination": true,
    "fullTextSearch": true
  }
}

🖼️ Image Generator

The image generator creates beautiful PNG quote cards with:

  • 18 curated gradient pairs — warm, vibrant, anime-inspired color schemes
  • Glass card overlay with rounded corners, drop shadow, and border glow
  • Auto-sizing fonts — 28px to 40px based on quote length
  • Decorative quote mark watermark in the background
  • Dedicated watermark bar with API attribution
  • Random font selection — Noto Sans (serif) or Anime Ace (display)
  • Noise texture overlay for visual depth
  • Unicode curly quotes ("") for proper typography

Supported fonts:

Font Style Use Case
Noto Sans Bold Clean sans-serif Default for English quotes
Noto Sans Italic Elegant italic Attribution text
Noto Sans JP Bold Japanese sans-serif Japanese quotes
Anime Ace Anime display font Random 35% chance for variety

🌍 Supported Languages

Code Language Status
en English ✅ Primary (800+ quotes)
jp Japanese ✅ Pre-translated
ko Korean ✅ Pre-translated
zh Chinese ✅ Pre-translated
hi Hindi ✅ Pre-translated
es Spanish ✅ Pre-translated
fr French ✅ Pre-translated
de German ✅ Pre-translated
pt Portuguese ✅ Pre-translated
ru Russian ✅ Pre-translated
it Italian ✅ Pre-translated

Missing a language? Request it via GitHub Issues or submit a translation PR.


🚀 Quick Start

Deploy to Vercel

Deploy with Vercel

Local Development

git clone https://github.com/Shineii86/AniQuotesAPI.git
cd AniQuotesAPI && npm install && npm run dev
# → http://localhost:3000

🔧 Configuration

Variable Default Description
LIBRETRANSLATE_URL https://libretranslate.com Custom LibreTranslate instance URL
LIBRETRANSLATE_API_KEY (none) API key for LibreTranslate (if required)

Tip: For production use, self-host LibreTranslate for unlimited translations without rate limits.


🛠️ Tech Stack

Layer Technology
Runtime Node.js ≥ 18
HTTP Vercel Serverless Functions
Canvas @napi-rs/canvas (image generation)
Translation LibreTranslate API
External Data Animechan API
Caching In-memory TTL cache

📁 Project Structure

AniQuotesAPI/
├── api/                        # Vercel serverless functions
│   ├── v1/
│   │   ├── random.js           # Random quote
│   │   ├── anime.js            # Quotes by anime
│   │   ├── character.js        # Quotes by character
│   │   └── search.js           # Full-text search
│   ├── v2/
│   │   ├── languages.js        # Multilingual + auto-translate
│   │   └── image.js            # PNG image generation
│   ├── status.js               # Health & statistics
│   └── badge.js                # Shields.io badge endpoint
├── data/
│   ├── quotes.json             # 800+ English quotes
│   └── languages/              # Pre-translated quotes (10 files)
├── fonts/                      # Custom fonts for image generation
│   ├── Anime/                  # Anime Ace, AnimeFont
│   ├── NotoSans/               # Regular, Bold, Italic, BoldItalic
│   └── NotoSansJP/             # Japanese variant
├── utils/                      # Core logic
│   ├── providers/
│   │   ├── index.js            # Provider manager (aggregator)
│   │   └── animechan.js        # Animechan API provider
│   ├── cache.js                # In-memory TTL cache
│   ├── config.js               # Shared metadata & buildMeta()
│   ├── helpers.js              # Data loading, filtering, pagination
│   ├── errors.js               # Standardized error responses
│   ├── translator.js           # LibreTranslate auto-translation
│   ├── imageGenerator.js       # Canvas-based PNG generator
│   └── stats.js                # Quote statistics
├── public/
│   ├── index.html              # Landing page
│   ├── tos.html                # Terms of Service
│   └── privacy.html            # Privacy Policy
├── vercel.json                 # Vercel routing & headers
├── package.json
├── CHANGELOG.md
└── README.md

🤝 Contributing

Add New Quotes

  1. Fork the repository
  2. Add quotes to data/quotes.json:
{
  "id": 802,
  "quote": "Your favorite quote here",
  "anime": "Anime Title",
  "character": "Character Name",
  "language": "en"
}
  1. Submit a Pull Request

Translate Existing Quotes

  1. Open the target language file in data/languages/ (e.g., fr.json)
  2. Add translated quotes with the same ID as the English original
  3. Submit a Pull Request

Add a New External Provider

  1. Create utils/providers/newprovider.js:
async function getRandom() { /* returns { quote, anime, character, language } or null */ }
async function getByAnime(name) { /* returns quote[] */ }
async function getByCharacter(name) { /* returns quote[] */ }
module.exports = { getRandom, getByAnime, getByCharacter, name: 'newprovider' };
  1. Register in utils/providers/index.jsproviders array
  2. Test and submit a PR

📄 License

MIT © Shinei Nouzen


🙏 Acknowledgments

Source About
Animechan Community anime quotes API
LibreTranslate Free, open-source translation API
Noto Sans Google's font family for all languages
Anime Ace Anime-style display font

Built with ❤️ for the anime community

Telegram GitHub Instagram Gmail

Star this repo · 🐛 Report a bug · 💡 Request a feature

About

Multilingual anime quotes API — fetch randomly, by anime title, or by character. Open-source, no auth, designed for bots and content creators.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors