Они, должно быть, изменили свой API, поскольку их ответ выглядит следующим образом:
{
"1": {
"station": {
"id": 2,
"name": "test",
"shortcode": "test",
"description": "",
"frontend": "shoutcast2",
"backend": "liquidsoap",
"listen_url": "https:\\/\\/guardi.wearebounce.net:8010\\/radio.mp3?1572279272",
"is_public": true,
"mounts": [{
"path": "\\/radio.mp3",
"is_default": true,
"id": 4,
"name": "128kbps MP3",
"url": "https:\\/\\/guardi.wearebounce.net:8010\\/radio.mp3?1572279272",
"bitrate": 128,
"format": "mp3",
"listeners": {
"current": 0,
"unique": 0,
"total": 0
}
}],
"remotes": []
},
"listeners": {
"current": 0,
"unique": 0,
"total": 0
},
"live": {
"is_live": false,
"streamer_name": ""
},
"now_playing": {
"elapsed": 2085856,
"remaining": 0,
"sh_id": 16422,
"played_at": 1570193422,
"duration": 0,
"playlist": "",
"is_request": false,
"song": {
"id": "ab574fe34f592faf5c3f27dbc52088a4",
"text": "AzuraCast.com - AzuraCast is Live!",
"artist": "AzuraCast.com",
"title": "AzuraCast is Live!",
"album": "",
"lyrics": "",
"art": "https:\\/\\/wearebounce.net\\/branding\\/LogoIconColour.png",
"custom_fields": []
}
},
"playing_next": null,
"song_history": [{
"sh_id": 16421,
"played_at": 1570193242,
"duration": 0,
"playlist": "",
"is_request": false,
"song": {
"id": "a723e3dfb497b24c5f730bad44328916",
"text": "Animals",
"artist": "",
"title": "Animals",
"album": "",
"lyrics": "",
"art": "https:\\/\\/wearebounce.net\\/branding\\/LogoIconColour.png",
"custom_fields": []
}
}, {
"sh_id": 16419,
"played_at": 1570193227,
"duration": 0,
"playlist": "",
"is_request": false,
"song": {
"id": "de05db4a94a8e9b547504e9e51682bfd",
"text": "Bounce_ - _Bed_6",
"artist": "Bounce_",
"title": "_Bed_6",
"album": "",
"lyrics": "",
"art": "https:\\/\\/wearebounce.net\\/branding\\/LogoIconColour.png",
"custom_fields": []
}
}, {
"sh_id": 16417,
"played_at": 1570193032,
"duration": 0,
"playlist": "",
"is_request": false,
"song": {
"id": "ee0707f2222751ce78d5f2f358c50312",
"text": "Gangaman",
"artist": "",
"title": "Gangaman",
"album": "",
"lyrics": "",
"art": "https:\\/\\/wearebounce.net\\/branding\\/LogoIconColour.png",
"custom_fields": []
}
}, {
"sh_id": 16415,
"played_at": 1570192881,
"duration": 0,
"playlist": "",
"is_request": false,
"song": {
"id": "ad3cbc1061248ee1f594ca5932b35bbb",
"text": "Brave - Don Diablo",
"artist": "Brave",
"title": "Don Diablo",
"album": "",
"lyrics": "",
"art": "https:\\/\\/wearebounce.net\\/branding\\/LogoIconColour.png",
"custom_fields": []
}
}, {
"sh_id": 16414,
"played_at": 1570192852,
"duration": 0,
"playlist": "",
"is_request": false,
"song": {
"id": "ab574fe34f592faf5c3f27dbc52088a4",
"text": "AzuraCast.com - AzuraCast is Live!",
"artist": "AzuraCast.com",
"title": "AzuraCast is Live!",
"album": "",
"lyrics": "",
"art": "https:\\/\\/wearebounce.net\\/branding\\/LogoIconColour.png",
"custom_fields": []
}
}],
"cache": "station"
}
}
Таким образом, у них есть объект с ключом 1, а не массив объектов. Поскольку это объект, вам нужно получить к нему доступ через ключ. А поскольку ключ является числом, вам нужно получить его с помощью
$response = $api->{1};
К сожалению, цепочка не работает хорошо (по крайней мере, для меня), поэтому вам придется присвоить ее переменной каквыше. Тогда вы можете использовать
$response->live->is_live;