Skip to content
Projets

À propos

Lyrica API is a free, open-source Python tool to fetch unsynced, line-synced (LRC), word-level, and syllable-level synchronized song lyrics. Powered by real-time AI translation and transliteration (Romanization) across languages, it delivers clean, zero-friction JSON responses engineered for web apps, mobile clients, and desktop players.

Développement web et applicatif

Comment ces chiffres sont mesurés

What you can do

  • 🎵 Multi-Provider Aggregation: Aggregates from LRCLIB, Genius, Apple Music, YouTube Music, Lrcmux, NetEase, Megalobiz, and Musixmatch.
  • Line-Level (LRC): Sentence-by-sentence millisecond timing (&timestamps=true).
  • Word-Level (Karaoke): Per-word start and end timing for real-time highlighting (&word=true).
  • Syllable-Level: Sub-word vocal syllable timing via Apple Music AMP API (&syllabus=true).

Progression mesurée des étoiles

in 24h
+2
in 7 days
+6
in 15 days
+11
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

Lyrica

Lyrica Banner

High-performance, multi-provider lyrics aggregation API for plain, synchronized (LRC), word-level, and syllable-level lyrics with real-time AI translation.

CI/CD Status License: MIT Python Versions Docker Ready Documentation


📌 Overview

Lyrica aggregates song lyrics across 8 active sources with intelligent multi-sync degradation, sub-millisecond multi-tier caching (89k+ requests/sec), and real-time neural translation/romanization powered by Groq LLMs (openai/gpt-oss-120b).

Whether you are building a karaoke player, a music streaming client, an accessibility read-along tool, or a music discovery platform, Lyrica delivers consistent, structured JSON responses with zero mandatory configuration.

✨ Key Features

  • 🎵 Multi-Provider Aggregation: Aggregates from LRCLIB, Genius, Apple Music, YouTube Music, Lrcmux, NetEase, Megalobiz, and Musixmatch.
  • ⏱️ Multi-Granular Synchronization:
    • Line-Level (LRC): Sentence-by-sentence millisecond timing (&timestamps=true).
    • Word-Level (Karaoke): Per-word start and end timing for real-time highlighting (&word=true).
    • Syllable-Level: Sub-word vocal syllable timing via Apple Music AMP API (&syllabus=true).
  • 🤖 AI Translation & Romanization: Real-time lyrics translation and script transliteration via Groq LLMs.
  • ⚡ 89,000+ RPS Throughput: Multi-tier cache architecture (L1 In-Memory LRU + L2 Redis + L3 Disk) ensures sub-millisecond latency on cache hits.
  • 📊 Track Intelligence: Integrated mood analysis, emotional polarity, and rich metadata (cover art, genre, release date).
  • 🛡️ Production-Hardened: Gunicorn gevent concurrency (2,000+ conns/worker), unprivileged Docker user, tini PID 1, and health checks.

Note from the Developer

Lyrica v1.5 is the current stable release of the API. While it provides reliable access to the available features, it has certain limitations compared to the newer architecture.

An improved version, Lyrica v2-beta, is now available for testing as of November 4, 2026.

  • Stable Release (v1.5): Recommended for production use.
  • Beta Release (v2-beta): Introduces improvements and additional capabilities but may contain bugs or unexpected behaviour that could affect performance and reliability.

You can explore and test the beta version in the v2-beta-rollout branch.

Note: The v2-beta release is intended primarily for local development and testing. We do not recommend using it in production environments until it has been thoroughly tested and is officially released as stable.

Feedback & Contributions

Your feedback plays an important role in improving Lyrica. If you encounter bugs, experience unexpected behaviour, or have suggestions for new features, feel free to open an issue or share your feedback through the repository.

Thank you for supporting Lyrica!

— Team Lyrica

🚀 Quick Start

1. Run with Docker Compose (Recommended)

The fastest way to run Lyrica with full L2 Redis distributed caching:

git clone https://github.com/Wilooper/Lyrica.git
cd Lyrica
cp .env.example .env
docker compose up -d

The API is instantly live at http://localhost:7860/.

2. Run Locally with Python

git clone https://github.com/Wilooper/Lyrica.git
cd Lyrica
python -m venv venv
source venv/bin/activate  # On Windows: .\venv\Scripts\Activate.ps1
pip install -r requirements.txt
python run.py

The API is live at http://127.0.0.1:9999/.


💡 Verified API Examples

1. Fetch Plain Lyrics

curl "http://127.0.0.1:9999/lyrics/?artist=Coldplay&song=Yellow"
{
  "status": "success",
  "data": {
    "source": "lrclib",
    "artist": "Coldplay",
    "title": "Yellow",
    "hasTimestamps": false,
    "lyrics": "Look at the stars\nLook how they shine for you..."
  }
}

2. Synchronized Line-Level Lyrics (LRC)

curl "http://127.0.0.1:9999/lyrics/?artist=Coldplay&song=Yellow&timestamps=true"
{
  "status": "success",
  "data": {
    "source": "lrclib",
    "artist": "Coldplay",
    "title": "Yellow",
    "sync_level": "line",
    "hasTimestamps": true,
    "timed_lyrics": [
      { "id": "lrc_0", "text": "Look at the stars", "start_time": 36189, "end_time": 37719 }
    ]
  }
}

3. Word-Level Sync (Karaoke Mode)

curl "http://127.0.0.1:9999/lyrics/?artist=Coldplay&song=Yellow&timestamps=true&word=true"
{
  "status": "success",
  "data": {
    "source": "lrcmux",
    "artist": "Coldplay",
    "title": "Yellow",
    "sync_level": "word",
    "hasTimestamps": true,
    "timed_lyrics": [
      {
        "id": "lrc_0",
        "text": "Look at the stars",
        "start_time": 36189,
        "end_time": 37719,
        "words": [
          { "word": "Look", "start": 36189, "end": 36520 },
          { "word": "at", "start": 36520, "end": 36800 },
          { "word": "the", "start": 36800, "end": 37050 },
          { "word": "stars", "start": 37050, "end": 37719 }
        ]
      }
    ]
  }
}

4. Real-Time Translation & Romanization (Groq LLM)

curl "http://127.0.0.1:9999/lyrics/?artist=Karan%20Aujla&song=Boyfriend&timestamps=true&translate=true&romanize=true&language=en"

5. Song Autocomplete & Suggestions

curl "http://127.0.0.1:9999/suggestion?q=Bohemian%20Rhapsody&limit=3"

🏗️ Architecture Overview

graph LR
    Client([Client Application]) --> Router[Flask REST API]
    Router --> Cache{L1/L2/L3 Cache}
    Cache -- Hit (0.003ms) --> Client
    Cache -- Miss --> Controller[Fetch Controller]
    Controller --> P1[LRCLIB]
    Controller --> P2[Lrcmux]
    Controller --> P3[Genius]
    Controller --> P4[Apple Music]
    Controller --> P5[YouTube / Others]
    Controller --> LLM[Groq AI Processor]
    Controller --> SaveCache[Multi-Tier Cache Save]
    SaveCache --> Client

🎵 Provider Registry

ID Provider Lyrics Type Sync Capabilities Authentication
1 Genius Plain Complete Verses (Depth-Tracking) None needed (Public Web Search fallback) or GENIUS_TOKEN
2 LRCLIB Timestamped + Plain Line-Level Free, no token required
3 YouTube Music Timestamped + Plain Line-Level Free (3-layer fallback)
4 NetEase Timestamped Line-Level Free
5 Megalobiz Timestamped Line-Level Free
6 Musixmatch Timestamped Line-Level MUSIXMATCH_TOKEN (optional)
7 Lrcmux Timestamped + Word-Level Line & Word Free via api.lrcmux.dev
8 Apple Music Timestamped + Word + Syllable Line, Word & Syllable APPLE_MUSIC_DEVELOPER_TOKEN

Default Fallback Sequence: LRCLIB (2) → Lrcmux (7) → Genius (1) → YouTube (3) → NetEase (4) → Megalobiz (5) → Musixmatch (6) → Apple Music (8)


📚 Complete Documentation

Full, structured documentation is available in the docs/ directory and online:


🧪 Testing & Verification

Lyrica includes an end-to-end automated test harness:

# Run all unit, live integration, and performance benchmarks
python Test/run_all_tests.py

Results:

  • Genius Parser Unit Tests: Verified depth-tracking parsing without missing verses.
  • Live Integration Tests: Live requests against real Genius servers (The Weeknd, Queen).
  • Performance Benchmark: 89,182 req/s on L1 cache, 4,276 req/s on concurrent Flask routes.

🤝 Contributing & Community

Contributions are warmly welcomed! Please read our Contributing Guide and Code of Conduct before submitting a Pull Request.

Wilooper
Shaurya singh (@Wilooper)
thinkely
Shaurya singh (@thinkely)
rombat
Romain Batigne
shelbeely
Shelbee Johnson

📝 License

Licensed under the MIT License © 2026 Lyrica Contributors. Made with ❤️ by Shaurya Singh (Wilooper) and the open-source community.

Explorer des projets similaires

Chargement…