Access item in JSON result

后端 未结 3 974
[愿得一人]
[愿得一人] 2021-01-26 15:56

I am a bit confused as to how access artists name in this JSON result:

{
  \"tracks\" : {
    \"href\" : \"https://api.spotify.com/         


        
3条回答
  •  -上瘾入骨i
    2021-01-26 16:19

    You should do items = results['tracks']['items'][0]['artists'][0]['name'](although this is technically hardcoded)

    As your artist and items object are arrays (with only one, so we reference the first with [0])

提交回复
热议问题