diff --git a/README.md b/README.md index 205d75b..23218a1 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@
- A music API built with Deno for searching, streaming, and exploring music data from YouTube Music, YouTube, and Last.fm. + Music API for YouTube Music, Lyrics & Streaming
@@ -14,143 +14,104 @@ --- -## Overview - -Virome API provides a unified interface to access music data from multiple sources. It includes a built-in web UI for testing endpoints and playing music directly in the browser. - ## Features -- Search songs, albums, artists, and playlists -- Get song lyrics with synced timestamps -- Stream audio from YouTube via Piped/Invidious proxies -- Generate radio mixes based on a song -- Get trending music and top artists by country -- Artist and track information from Last.fm +- Search songs, albums, artists with fallback video IDs for playback +- Get synced lyrics (LRC format) +- Stream audio via Piped/Invidious proxies +- Generate radio mixes from any song +- Trending music and top artists by country +- Artist/track info from Last.fm - Built-in music player with YouTube IFrame API +- Auto region detection from IP -## Installation - -### Requirements - -- Deno 1.40 or higher - -### Run Locally +## Quick Start ```bash -cd deno-music-api deno run --allow-net --allow-env --allow-read mod.ts ``` -The server starts at `http://localhost:8000` - -### Deploy to Deno Deploy - -1. Push the code to a GitHub repository -2. Go to https://dash.deno.com -3. Create a new project and link your repository -4. Set the entry point to `mod.ts` +Server runs at `http://localhost:8000` ## API Endpoints ### Search -| Endpoint | Description | Parameters | -|----------|-------------|------------| -| GET /api/search | Search YouTube Music | q, filter (songs/albums/artists) | -| GET /api/yt_search | Search YouTube | q, filter (videos/channels/playlists) | -| GET /api/search/suggestions | Get search suggestions | q | +| Endpoint | Description | +|----------|-------------| +| `/api/search?q=&filter=` | Search YouTube Music (songs/albums/artists) | +| `/api/yt_search?q=&filter=` | Search YouTube (videos/channels/playlists) | +| `/api/search/suggestions?q=` | Autocomplete suggestions | ### Content -| Endpoint | Description | Parameters | -|----------|-------------|------------| -| GET /api/songs/:videoId | Get song details | videoId | -| GET /api/albums/:browseId | Get album tracks | browseId | -| GET /api/artists/:browseId | Get artist info | browseId | -| GET /api/playlists/:playlistId | Get playlist tracks | playlistId | +| Endpoint | Description | +|----------|-------------| +| `/api/songs/:videoId` | Song details with artist/album links | +| `/api/albums/:browseId` | Album with tracks and artist | +| `/api/artists/:browseId` | Artist with discography | +| `/api/playlists/:playlistId` | Playlist tracks | +| `/api/chain/:videoId` | Full chain: Song → Artist → Albums | ### Discovery -| Endpoint | Description | Parameters | -|----------|-------------|------------| -| GET /api/related/:videoId | Get related songs | videoId | -| GET /api/similar | Find similar tracks | title, artist | -| GET /api/trending | Trending music by country | country | -| GET /api/radio | Generate radio mix | videoId | -| GET /api/top/artists | Top artists by country | country, limit | -| GET /api/top/tracks | Top tracks by country | country, limit | +| Endpoint | Description | +|----------|-------------| +| `/api/related/:videoId` | Related songs | +| `/api/radio?videoId=` | Generate radio mix | +| `/api/similar?title=&artist=` | Similar tracks | +| `/api/charts?country=` | Music charts | +| `/api/trending?country=` | Trending music | +| `/api/moods` | Mood categories | +| `/api/top/artists?country=` | Top artists | +| `/api/top/tracks?country=` | Top tracks | + +### Streaming & Lyrics + +| Endpoint | Description | +|----------|-------------| +| `/api/stream?id=` | Audio stream URLs | +| `/api/proxy?url=` | Audio proxy (CORS bypass) | +| `/api/lyrics?title=&artist=` | Synced lyrics (LRC) | ### Info -| Endpoint | Description | Parameters | -|----------|-------------|------------| -| GET /api/lyrics | Get song lyrics | title, artist | -| GET /api/artist/info | Artist bio and stats | artist | -| GET /api/track/info | Track details | title, artist | +| Endpoint | Description | +|----------|-------------| +| `/api/artist/info?artist=` | Artist bio (Last.fm) | +| `/api/track/info?title=&artist=` | Track info (Last.fm) | -### Streaming +## Examples -| Endpoint | Description | Parameters | -|----------|-------------|------------| -| GET /api/stream | Get stream URLs | id | -| GET /api/watch_playlist | Get watch playlist | videoId or playlistId | -| GET /health | Health check | - | +```bash +# Search songs +curl "https://verome-api.deno.dev/api/search?q=Blinding%20Lights&filter=songs" -## Usage Examples +# Get lyrics +curl "https://verome-api.deno.dev/api/lyrics?title=Blinding%20Lights&artist=The%20Weeknd" -### Search for songs +# Stream URLs +curl "https://verome-api.deno.dev/api/stream?id=4NRXx6U8ABQ" -``` -GET /api/search?q=Blinding%20Lights&filter=songs -``` - -### Get lyrics - -``` -GET /api/lyrics?title=Blinding%20Lights&artist=The%20Weeknd -``` - -### Get stream URLs - -``` -GET /api/stream?id=4NRXx6U8ABQ -``` - -### Get top artists from a country - -``` -GET /api/top/artists?country=Tunisia&limit=20 -``` - -### Generate radio from a song - -``` -GET /api/radio?videoId=4NRXx6U8ABQ +# Radio mix +curl "https://verome-api.deno.dev/api/radio?videoId=4NRXx6U8ABQ" ``` ## Project Structure ``` -deno-music-api/ - mod.ts - Main server and route handlers - lib.ts - API clients (YouTube Music, YouTube, Last.fm) - ui.ts - Web UI HTML template - deno.json - Deno configuration - assets/ - Logo.png - Project logo +mod.ts - Server and routes +lib.ts - API clients (YT Music, YouTube, Last.fm, LRCLib) +ui.ts - Web UI +assets/ - Logo ``` -## Data Sources +## Deploy -- YouTube Music API (unofficial) -- YouTube Data (via Invidious/Piped) -- Last.fm API (artist info, similar tracks) -- LRCLib (lyrics) +```bash +deployctl deploy --project=verome-api --prod mod.ts +``` ## License MIT - -## Disclaimer - -This is an unofficial API for educational purposes. It is not affiliated with YouTube, Google, or Last.fm.