HTTP Server
NCMGET includes a built-in HTTP server powered by Hono, allowing you to access NCMGET's functionality via REST API endpoints.
Starting the Server
Use the serve command to start the server:
See serve for full command details.
REST Endpoints
All endpoints are accessible via GET requests. Query parameters are used for input.
GET /search
Search for music resources.
GET /song
Get song details.
GET /album
Get album songs.
GET /artist
Get artist hot songs.
GET /playlist
Get playlist songs.
GET /url
Get audio playback URL.
GET /lrc
Get lyrics with translation.
GET /pic
Get cover image URL.
GET /
Lists all available routes.
Middleware Behavior
CORS
CORS is enabled globally on all endpoints. All origins are allowed, making the server suitable for frontend integration.
Per-Request NCMGET Instance
A new NCMGET instance is created for each incoming request. This ensures request isolation — one request's configuration (cookie, format mode) does not affect another.
Cookie via Request Header
You can pass a cookie string via the Cookie HTTP header on any request. The server will apply it to the per-request NCMGET instance:
Raw Mode
Append the ?raw query parameter to any endpoint to receive the unformatted raw API response instead of the formatted output:
Response Format
All endpoints return JSON responses. The structure depends on whether ?raw is used:
- Formatted (default): Returns the structured data as documented in Types
- Raw: Returns the original NetEase Cloud Music API response
