Skip to content

TharukRenuja/SyncLRC

Repository files navigation

SyncLRC 🎵

SyncLRC is a simple, minimalist lyrics finder designed to help you discover and export lyrics in multiple formats. Whether you need word-by-word Karaoke lyrics, time-synced LRC files, or simple plain text, SyncLRC has you covered.

✨ Features

  • Triple Format Support: Fetch lyrics in Karaoke (Enhanced LRC), Synced (Standard LRC), and Plain Text formats.
  • Smart Fallback: If your preferred format isn't available, the app gracefully lets you know and suggests alternatives.
  • Enhanced Provider Selection: Prioritizes top-tier sources like Musixmatch and LRCLIB to ensure high-quality, synchronized lyrics.
  • Original Language Preference: Intelligent language detection ensures the original lyrics are prioritized over translations, especially for international tracks.
  • Clean Sanitization: Automatically filters out metadata and credit clutter (lyricists, composers, etc.) for a distraction-free experience.
  • Developer API: Built-in /search /lyrics endpoints for programmatic access to lyrics data.
  • Web Access: General users can easily search for tracks and view all lyrics formats directly through the intuitive web interface.

🛠️ Developer API

Devs can fetch lyrics directly via the following endpoint:

Endpoints

1. Search Tracks & Lyrics

GET /search?query={query}&limit={limit}&offset={offset}

Parameters:

  • query: (Required) Search term (track or artist).
  • limit: (Optional) Max results (default 10).
  • offset: (Optional) Pagination offset (default 0).

Response:

{
  "results": [
    {
      "id": "a1b2c3d4e5f6g7h8...",
      "track": "Song Name",
      "artist": "Artist Name",
      "lyrics": {
        "plain": "Lyrics text...",
        "synced": "[00:00.00]...",
        "karaoke": "[00:00.00]<00:00.05>..."
      }
    }
  ],
  "total": 10,
  "limit": 25,
  "offset": 0
}

2. Fetch Specific Lyrics

GET /lyrics?track={track}&artist={artist}&type={type} GET /lyrics?id={id}

Parameters:

  • id: (Optional) Unique hash to fetch specific lyrics (bypasses track/artist).
  • track: (Required if no id) Song name.
  • artist: (Required if no id) Artist name.
  • type: (Optional) karaoke, synced, or plain.

Response:

{
  "id": "a1b2c3d4e5f6g7h8...",
  "track": "Song Name",
  "artist": "Artist Name",
  "lyrics": "[00:00.00]...",
  "type": "synced"
}

Rate Limits

To ensure fair usage and stability, the API has the following rate limits:

  • Search (/search): 60 requests per minute (~1 req/sec).
  • Lyrics (/lyrics): 300 requests per minute (~5 req/sec).
  • Global: 2,000 requests per day (per IP).

Exceeding these limits will result in a 429 Too Many Requests response.

Note: These limits may be increased in the future as our databases grow or if we can host SyncLRC on a real server. If you'd like to support this or donate, please connect with Tharuk (check social links on profile) or donate at tharuk.pro/donate.

🤝 Contributing

Contributions are welcome!

  1. Improvements: Feel free to open an issue or pull request.
  2. Sanitization: We maintain a list of strings to filter out (like "Synced by", "Translated by"). If you find more clutter in lyrics, please add them to the sanitization list in sanitize.py.

📜 Credits

This project uses the iTunes Search API to fetch track metadata and syncedlyrics for fetching lyrics from Musixmatch, LRCLIB, and Netease.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Built with ❤️ by Tharuk Renuja