Update README with cleaner API docs

This commit is contained in:
Your Name
2026-01-11 18:38:20 +01:00
parent 881f13cb48
commit cdbac64159

163
README.md
View File

@@ -5,7 +5,7 @@
<h1 align="center">Virome API</h1> <h1 align="center">Virome API</h1>
<p align="center"> <p align="center">
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
</p> </p>
<p align="center"> <p align="center">
@@ -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 ## Features
- Search songs, albums, artists, and playlists - Search songs, albums, artists with fallback video IDs for playback
- Get song lyrics with synced timestamps - Get synced lyrics (LRC format)
- Stream audio from YouTube via Piped/Invidious proxies - Stream audio via Piped/Invidious proxies
- Generate radio mixes based on a song - Generate radio mixes from any song
- Get trending music and top artists by country - Trending music and top artists by country
- Artist and track information from Last.fm - Artist/track info from Last.fm
- Built-in music player with YouTube IFrame API - Built-in music player with YouTube IFrame API
- Auto region detection from IP
## Installation ## Quick Start
### Requirements
- Deno 1.40 or higher
### Run Locally
```bash ```bash
cd deno-music-api
deno run --allow-net --allow-env --allow-read mod.ts deno run --allow-net --allow-env --allow-read mod.ts
``` ```
The server starts at `http://localhost:8000` Server runs 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`
## API Endpoints ## API Endpoints
### Search ### Search
| Endpoint | Description | Parameters | | Endpoint | Description |
|----------|-------------|------------| |----------|-------------|
| GET /api/search | Search YouTube Music | q, filter (songs/albums/artists) | | `/api/search?q=&filter=` | Search YouTube Music (songs/albums/artists) |
| GET /api/yt_search | Search YouTube | q, filter (videos/channels/playlists) | | `/api/yt_search?q=&filter=` | Search YouTube (videos/channels/playlists) |
| GET /api/search/suggestions | Get search suggestions | q | | `/api/search/suggestions?q=` | Autocomplete suggestions |
### Content ### Content
| Endpoint | Description | Parameters | | Endpoint | Description |
|----------|-------------|------------| |----------|-------------|
| GET /api/songs/:videoId | Get song details | videoId | | `/api/songs/:videoId` | Song details with artist/album links |
| GET /api/albums/:browseId | Get album tracks | browseId | | `/api/albums/:browseId` | Album with tracks and artist |
| GET /api/artists/:browseId | Get artist info | browseId | | `/api/artists/:browseId` | Artist with discography |
| GET /api/playlists/:playlistId | Get playlist tracks | playlistId | | `/api/playlists/:playlistId` | Playlist tracks |
| `/api/chain/:videoId` | Full chain: Song → Artist → Albums |
### Discovery ### Discovery
| Endpoint | Description | Parameters | | Endpoint | Description |
|----------|-------------|------------| |----------|-------------|
| GET /api/related/:videoId | Get related songs | videoId | | `/api/related/:videoId` | Related songs |
| GET /api/similar | Find similar tracks | title, artist | | `/api/radio?videoId=` | Generate radio mix |
| GET /api/trending | Trending music by country | country | | `/api/similar?title=&artist=` | Similar tracks |
| GET /api/radio | Generate radio mix | videoId | | `/api/charts?country=` | Music charts |
| GET /api/top/artists | Top artists by country | country, limit | | `/api/trending?country=` | Trending music |
| GET /api/top/tracks | Top tracks by country | country, limit | | `/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 ### Info
| Endpoint | Description | Parameters | | Endpoint | Description |
|----------|-------------|------------| |----------|-------------|
| GET /api/lyrics | Get song lyrics | title, artist | | `/api/artist/info?artist=` | Artist bio (Last.fm) |
| GET /api/artist/info | Artist bio and stats | artist | | `/api/track/info?title=&artist=` | Track info (Last.fm) |
| GET /api/track/info | Track details | title, artist |
### Streaming ## Examples
| Endpoint | Description | Parameters | ```bash
|----------|-------------|------------| # Search songs
| GET /api/stream | Get stream URLs | id | curl "https://verome-api.deno.dev/api/search?q=Blinding%20Lights&filter=songs"
| GET /api/watch_playlist | Get watch playlist | videoId or playlistId |
| GET /health | Health check | - |
## 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"
``` # Radio mix
GET /api/search?q=Blinding%20Lights&filter=songs curl "https://verome-api.deno.dev/api/radio?videoId=4NRXx6U8ABQ"
```
### 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
``` ```
## Project Structure ## Project Structure
``` ```
deno-music-api/ mod.ts - Server and routes
mod.ts - Main server and route handlers lib.ts - API clients (YT Music, YouTube, Last.fm, LRCLib)
lib.ts - API clients (YouTube Music, YouTube, Last.fm) ui.ts - Web UI
ui.ts - Web UI HTML template assets/ - Logo
deno.json - Deno configuration
assets/
Logo.png - Project logo
``` ```
## Data Sources ## Deploy
- YouTube Music API (unofficial) ```bash
- YouTube Data (via Invidious/Piped) deployctl deploy --project=verome-api --prod mod.ts
- Last.fm API (artist info, similar tracks) ```
- LRCLib (lyrics)
## License ## License
MIT MIT
## Disclaimer
This is an unofficial API for educational purposes. It is not affiliated with YouTube, Google, or Last.fm.