![](/img/trans.png)
[英]Using get_artist_audio_features from spotifyr when artist name doesn't work
[英]How do it get id of artist using spotifyr?
我試圖根據藝術家姓名、專輯等獲取藝術家的 id。似乎無法找到這樣做的方法。 請幫我解決。 我不需要整個程序,只需要關於如何通過專輯名稱或藝術家名稱或兩者返回 id 的部分。
非常感謝您的所有幫助。
我查看了https://cran.r-project.org/web/packages/spotifyr/spotifyr.pdf 中的文檔仍然沒有
例子:
artist = "enya"
df = spotifyr::get_artist_audio_features(artist)
names(df)
[1] "artist_name" "artist_id" "album_id"
[4] "album_type" "album_images" "album_release_date"
[7] "album_release_year" "album_release_date_precision" "danceability"
[10] "energy" "key" "loudness"
[13] "mode" "speechiness" "acousticness"
[16] "instrumentalness" "liveness" "valence"
[19] "tempo" "track_id" "analysis_url"
[22] "time_signature" "artists" "available_markets"
[25] "disc_number" "duration_ms" "explicit"
[28] "track_href" "is_local" "track_name"
[31] "track_preview_url" "track_number" "type"
[34] "track_uri" "external_urls.spotify" "album_name"
[37] "key_name" "mode_name" "key_mode"
View(df)
您可以看到返回了字段artist_id
。 在這個例子中:
print(df$artist_id[1])
"6uothxMWeLWIhsGeF7cyo4"
我希望它有幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.