SimpMusic.Lyrics.Client
1.2.0
dotnet add package SimpMusic.Lyrics.Client --version 1.2.0
NuGet\Install-Package SimpMusic.Lyrics.Client -Version 1.2.0
<PackageReference Include="SimpMusic.Lyrics.Client" Version="1.2.0" />
<PackageVersion Include="SimpMusic.Lyrics.Client" Version="1.2.0" />
<PackageReference Include="SimpMusic.Lyrics.Client" />
paket add SimpMusic.Lyrics.Client --version 1.2.0
#r "nuget: SimpMusic.Lyrics.Client, 1.2.0"
#:package SimpMusic.Lyrics.Client@1.2.0
#addin nuget:?package=SimpMusic.Lyrics.Client&version=1.2.0
#tool nuget:?package=SimpMusic.Lyrics.Client&version=1.2.0
SimpMusic.Lyrics.Client
A .NET client library for the SimpMusic Lyrics API. Provides easy access to lyrics and translations for songs.
Features
- 🎵 Get lyrics by YouTube video ID
- 🌍 Support for translated lyrics in multiple languages
- 🔍 Search lyrics by title, artist, or query
- ⬆️ Submit new lyrics and translations (requires HMAC authentication)
- 👍 Vote for lyrics and translations
- ⚡ Fully async/await support
- 📦 .NET Standard 2.0 compatible
Installation
Install via NuGet:
dotnet add package SimpMusic.Lyrics.Client
Or via Package Manager:
Install-Package SimpMusic.Lyrics.Client
Quick Start
using SimpMusic.Lyrics.Client.Api;
using SimpMusic.Lyrics.Client.Model;
// Create API instance
var api = new LyricsApi();
// Get lyrics by video ID
// Note: The API returns lyrics in a wrapper format with a data array
// The client automatically extracts the first item for GetLyricsByVideoIdAsync
var lyrics = await api.GetLyricsByVideoIdAsync("Y9SmNz2RofI");
if (lyrics != null && !string.IsNullOrWhiteSpace(lyrics.PlainLyric))
{
Console.WriteLine($"Song: {lyrics.SongTitle}");
Console.WriteLine($"Artist: {lyrics.ArtistName}");
Console.WriteLine($"Lyrics:\n{lyrics.PlainLyric}");
}
else
{
Console.WriteLine("No lyrics found for this video.");
}
// Search for lyrics
var searchApi = new SearchApi();
var searchResults = await searchApi.SearchLyricsAsync("demons", limit: 5);
if (searchResults != null && searchResults.Data != null && searchResults.Data.Count > 0)
{
Console.WriteLine($"Found {searchResults.Data.Count} results:");
foreach (var result in searchResults.Data)
{
Console.WriteLine($"- {result.SongTitle} by {result.ArtistName}");
}
}
Rate Limiting
The API enforces rate limiting:
- 30 requests per minute per IP address
- Rate limit headers are included in all responses:
X-RateLimit-Limit: Maximum requests allowedX-RateLimit-Remaining: Remaining requests in current windowX-RateLimit-Reset: Unix timestamp when limit resets
- When exceeded, returns HTTP 429 with
Retry-Afterheader
API Endpoints
Lyrics
GetLyricsByVideoIdAsync(videoId, limit?, offset?)- Get lyrics by YouTube video ID- Note: The API returns lyrics in a wrapper format
{"type": "success", "data": [{...}], "success": true}. The client automatically extracts the first item from thedataarray.
- Note: The API returns lyrics in a wrapper format
CreateLyricAsync(body)- Create new lyric (requires HMAC auth)
Translations
GetTranslatedLyricsByVideoIdAsync(videoId)- Get all translations for a video- Returns
TranslatedLyricsListResponsewithDataarray containing all translations
- Returns
GetTranslatedLyricsByVideoIdAndLanguageAsync(videoId, language)- Get translation in specific language- Returns
TranslatedLyricsListResponsewithDataarray
- Returns
CreateTranslatedLyricAsync(body)- Create new translation (requires HMAC auth)
Search
SearchLyricsAsync(query, limit?, offset?)- Search lyrics by query- Returns
LyricsListResponsewithDataarray containing search results
- Returns
SearchLyricsByTitleAsync(title, limit?, offset?)- Search by song title- Returns
LyricsListResponsewithDataarray
- Returns
SearchLyricsByArtistAsync(artist, limit?, offset?)- Search by artist name- Returns
LyricsListResponsewithDataarray
- Returns
Voting
VoteForLyricAsync(body)- Vote for a lyric (requires HMAC auth)VoteForTranslatedLyricAsync(body)- Vote for a translation (requires HMAC auth)
API Response Format
All API endpoints return responses in a wrapper format:
{
"type": "success",
"data": [...],
"success": true
}
- GetLyricsByVideoIdAsync: Returns a single
LyricsResponse(client extracts first item fromdataarray) - Search endpoints: Return
LyricsListResponsewithDataarray containing multiple results - Translation endpoints: Return
TranslatedLyricsListResponsewithDataarray containing translations
HMAC Authentication
For POST/PUT/DELETE operations, HMAC authentication is required. The client automatically handles HMAC generation when configured:
// Configure HMAC secret (default: "simpmusic-lyrics")
SimpMusic.Lyrics.Client.Configuration.Default.HmacSecretKey = "simpmusic-lyrics";
// Or configure per-instance
var config = new Configuration();
config.HmacSecretKey = "simpmusic-lyrics";
var api = new LyricsApi(config);
// The client automatically generates X-Timestamp and X-HMAC headers
// for all POST/PUT/DELETE/PATCH requests when HmacSecretKey is set
The HMAC is generated using:
- Algorithm: HMAC-SHA256
- Data:
timestamp + request_uri - Output: Base64-encoded string
- Headers:
X-Timestamp(Unix timestamp in milliseconds) andX-HMAC(generated token)
Documentation
Full API documentation is available at:
Requirements
- .NET Standard 2.0 or later
- RestSharp 111.4.1+
- Newtonsoft.Json 13.0.1+
License
This library is provided as-is. The SimpMusic Lyrics API is licensed under GPL-3.0.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Links
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- JsonSubTypes (>= 1.2.0)
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.1)
- RestSharp (>= 113.0.0)
- System.ComponentModel.Annotations (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.