Music

Music aggregation: scraping Aiting Music (home/singer/song/search) plus CRUD for the XiaoYing Music library. 2 channels are currently integrated.

/api/music/

Service Description

The music service aggregates two channels: Aiting Music (2t58) provides home charts, singers, song details, playback links with lyrics, and keyword search, making it suitable for building an online music search and playback page; XiaoYing Music is the platform's own library, offering CRUD for music and its playback sources plus JSON bulk import and export.

Both channels require project signature authentication. Data on the 2t58 channel is scraped from an external site in real time and playback links may expire, so avoid caching them on the client for long.

For XiaoYing Music, the import API accepts a single file up to 10 MB and up to 9999 records per call and does not de-duplicate; when an export exceeds 9999 records it returns a zip archive (containing several JSON parts) that can be imported back directly.

Response Format

Every endpoint returns the same JSON envelope; the payload is always inside data:

{
  "code": 10000,
  "msg": "成功",
  "data": { ... }
}
  • code: business status code. 10000 means success; anything else is an error — see the Error Codes page for the full list.
  • msg: a human-readable message you can show to end users, but never use it for program logic.
  • data: the payload; usually null on error. Each endpoint's Response section lists its data fields.

Judge success by code, not by the HTTP status code. View all error codes

Aiting Music 2t58

2t58.com web scraping (read-only) Signature Required

Scrape trending/singer/song/search data. The url parameter must be a 2t58.com domain address.

GET /api/music/2t58/home Total calls: 0

Home Data

Returns three modules: trending singers, song rising chart and pop trend chart.

Response Common envelope
Field Type Description
hot_singers array Hot singers
hot_singers[].name string Singer name
hot_singers[].image string Avatar image URL
hot_singers[].singer_url string Singer page URL
rising_chart array Rising songs chart
rising_chart[].song_name string Song name
rising_chart[].artists array Singer name list
rising_chart[].song_url string Song page URL
trend_chart array Trending chart
trend_chart[].song_name string Song name
trend_chart[].artists array Singer name list
trend_chart[].song_url string Song page URL
Example response
{
  "hot_singers": [
    {"name": "示例歌手", "image": "https://img.2t58.com/xxx.jpg",
     "singer_url": "https://www.2t58.com/singer/bm1z/1.html"}
  ],
  "rising_chart": [
    {"song_name": "示例歌曲", "artists": ["示例歌手"],
     "song_url": "https://www.2t58.com/song/d3dkc2t3.html"}
  ],
  "trend_chart": [
    {"song_name": "示例歌曲", "artists": ["示例歌手"],
     "song_url": "https://www.2t58.com/song/d3dkc2t3.html"}
  ]
}
GET /api/music/2t58/singer Total calls: 0

Singer Detail

Singer basic info + song list (paginated).

Full URL of the 2t58.com singer-song list page (Required)

Response Common envelope
Field Type Description
singer object Singer basic info
singer.name string Singer name
singer.cover string Cover image URL
singer.intro string Singer bio
songs array Song list
songs[].song_name string Song name
songs[].artists array Singer name list
songs[].song_url string Song page URL
pagination object Pagination info; null when unavailable
pagination.current object Current page {page,url}
pagination.current.page int Page Number
pagination.current.url string Page URL
pagination.first object First page {page,url}; null when absent
pagination.prev object Previous page {page,url}; null when absent
pagination.next object Next page {page,url}; null when absent
pagination.last object Last page {page,url}; null when absent
Example response
{
  "singer": {"name": "示例歌手", "cover": "https://img.2t58.com/xxx.jpg",
             "intro": "歌手简介"},
  "songs": [
    {"song_name": "示例歌曲", "artists": ["示例歌手"],
     "song_url": "https://www.2t58.com/song/d3dkc2t3.html"}
  ],
  "pagination": {
    "current": {"page": 1, "url": "https://www.2t58.com/singer/bm1z/1.html"},
    "first": null,
    "prev": null,
    "next": {"page": 2, "url": "https://www.2t58.com/singer/bm1z/2.html"},
    "last": {"page": 5, "url": "https://www.2t58.com/singer/bm1z/5.html"}
  }
}
GET /api/music/2t58/song Total calls: 0

Song Detail

Song basic info + playback URL + lyrics + daily recommendations.

Full URL of the 2t58.com song detail page (Required)

Response Common envelope
Field Type Description
song object Song basic info
song.song_name string Song name
song.artists array Singer name list
song.cover string Cover image URL
play_url string Play URL (decrypted); empty string on failure
lyrics string Lyrics in LRC format; empty string on failure
daily_recommend array Random recommendations
daily_recommend[].song_name string Song name
daily_recommend[].artists array Singer name list
daily_recommend[].song_url string Song page URL
Example response
{
  "song": {"song_name": "示例歌曲", "artists": ["示例歌手"],
           "cover": "https://img.2t58.com/xxx.jpg"},
  "play_url": "https://music.2t58.com/xxx.mp3",
  "lyrics": "示例歌词",
  "daily_recommend": [
    {"song_name": "示例歌曲", "artists": ["示例歌手"],
     "song_url": "https://www.2t58.com/song/d3dkc2t3.html"}
  ]
}
XiaoYingAPI · Unified API Aggregation Service