-
Notifications
You must be signed in to change notification settings - Fork 15
Music Taster Demo API Doc
Jayvee He edited this page Mar 20, 2017
·
5 revisions
- URL:
http://api.jayveehe.com/musictaster/similar/song/<song_name>
- Method:GET
- Data:
-
song_name
: 必填。歌曲名字,请确保使用UrlEncode(浏览器默认自动encode)
-
- 附带参数:
-
top_n
: 选填。返回的结果数,不带该参数则默认返回10个。
-
- Curl Example:
-
默认请求示例:
curl -X GET http://api.jayveehe.com/musictaster/similar/song/时代在召唤
-
带top_n请求示例:
curl -X GET http://api.jayveehe.com/musictaster/similar/song/浙江温州江南皮革厂倒闭了?top_n=20
-
- Response:
-
code
: 正确为200;错误400 -
result
: 包含一个数组,内含dict
-
- URL:
http://api.jayveehe.com/musictaster/similar/artist/<artist_name>
- Method:GET
- Data:
-
artist_name
: 必填。歌手名字,请确保使用UrlEncode(浏览器默认自动encode)
-
- 附带参数:
-
top_n
: 选填。返回的结果数,不带该参数则默认返回10个。
-
- Curl Example:
-
默认请求示例:
curl -X GET http://api.jayveehe.com/musictaster/similar/artist/周杰伦
-
带top_n请求示例:
curl -X GET http://api.jayveehe.com/musictaster/similar/artist/coldplay?top_n=20
-
- Response:
-
code
: 正确为200;错误400 -
result
: 包含一个数组,内含dict
-
该功能仅为娱乐,效果可能不尽人意。最好是单独进行歌曲的加减或单独进行歌手的加减。 目前分别加入了song2vec和artist2vec。
-
URL:
http://api.jayveehe.com/musictaster/similar/<type>
-
Method:POST
-
Data:
-
type
: 必填。控制返回结果的类型,song或artist -
positive_songs
: 选填。正影响的歌曲名字,数组形式。 -
positive_artists
: 选填。正影响的歌手名字,数组形式。 -
negative_songs
: 选填。负影响的歌曲名字,数组形式。 -
negative_artists
: 选填。负影响的歌手名字,数组形式。 -
top_n
: 选填。返回的结果数,不带该参数则默认返回10个。
-
-
备注: 参数2到5不可全部为空。
-
Data Example:
{ "positive_songs":["回到过去","yellow"], "negative_songs":["爱的供养","fix you"], "positive_artists":["周杰伦"], "negative_artists":["coldplay"], "top_n":5 }
-
Response:
- code: 正确为200;错误400
- result: 包含一个数组,内含dict
-
返回实例:
{ "code": 200, "result": [ { "name": "eclipse (all yours)", "similarity": 0.49911579489707947 }, { "name": "understand", "similarity": 0.4811088442802429 }, { "name": "castle on a cloud", "similarity": 0.4700777232646942 }, { "name": "healing touch", "similarity": 0.46122851967811584 }, { "name": "side by side", "similarity": 0.460138738155365 } ] }
- URL:
http://api.jayveehe.com/musictaster/cluster/playlist/url
- Method:POST
- Data:
- type: 必填。控制返回结果的类别。song或artist。
- url: 必填。网易云音乐歌单页面地址。
- Data Example:
{
"url": "http://music.163.com/#/playlist?id=109376827",
"type": "song"
}
- Curl Example:
curl -X POST -H "Content-type: application/json" -d '{"url":"http://music.163.com/#/playlist?id=109376827","type":"song"}' http://api.jayveehe.com/cluster/playlist/url
- Response:
- code: 正确为200;错误400
- result: 包含一个聚类结果的二维数组,每个子数组为一个簇
- playlist_name: 歌单的名字
- type: 聚类结果类型
- 返回实例:
{
"code": 200,
"type": "song",
"result": [
[
"xavii",
"summer ends",
"thunder in everyone of us",
"mariana",
"lights frightened the captain"
],
[
"in the shadows... looking for a light"
],
[
"妈妈,我考试考100分"
]
],
"playlist_name": "后摇"
}