Problems with reading a JSON File with stream data

I try to read JSON from a website, and display the data in an Kodular App
So far this is the JSON Part:

I am reading in the forum since hours, and cant find the solution.

This is the corresponding JSON Data:

{
“icestats”: {
“admin”: “icemaster@localhost”,
“banned_IPs”: 0,
“build”: 20220212051653,
“location”: “AzuraCast”,
“outgoing_kbitrate”: 1502,
“server_id”: “Icecast 2.4.0-kh15-ac1”,
“server_start”: “22/Jun/2022:00:36:01 +0200”,
“stream_kbytes_read”: 276807295,
“stream_kbytes_sent”: 1353356646,
“source”: [
{
“artist”: “Andrew Spencer feat. 740 Boyz”,
“audio_info”: “channels=2;samplerate=44100;bitrate=96”,
“bitrate”: 96,
“connected”: 5450975,
“genre”: “Dance”,
“incoming_bitrate”: 97448,
“listener_peak”: 14,
“listeners”: 6,
“metadata_updated”: “24/Aug/2022:02:44:27 +0200”,
“outgoing_kbitrate”: 558,
“queue_size”: 98286,
“server_type”: “audio/aac”,
“stream_start”: “22/Jun/2022:00:36:13 +0200”,
“title”: “Shimmy Shake 2k21 (Radio Edit)”,
“total_mbytes_sent”: 301886,
“yp_currently_playing”: “Andrew Spencer feat. 740 Boyz - Shimmy Shake 2k21 (Radio Edit)”
},
{
“artist”: “Andrew Spencer feat. 740 Boyz”,
“audio_info”: “channels=2;samplerate=44100;bitrate=320”,
“bitrate”: 320,
“connected”: 5450975,
“genre”: “Dance”,
“incoming_bitrate”: 325160,
“listener_peak”: 17,
“listeners”: 4,
“metadata_updated”: “24/Aug/2022:02:44:27 +0200”,
“outgoing_kbitrate”: 937,
“queue_size”: 539168,
“server_type”: “audio/mpeg”,
“stream_start”: “22/Jun/2022:00:36:12 +0200”,
“title”: “Shimmy Shake 2k21 (Radio Edit)”,
“total_mbytes_sent”: 1020919,
“yp_currently_playing”: “Andrew Spencer feat. 740 Boyz - Shimmy Shake 2k21 (Radio Edit)”
}
]
}
}

Since i seem to be too dumb to understand JSON and Kodular, i kindly ask for your help in how to display the data “title” and “artist” within a normal label.

Currently the app throws the following error at startup:
com.google.appinventor.components.runtime.util.YailDictionary.walkKeyPath(com.google.appinventor.components.runtime.util.YailObject,java.util.List)’ has wrong type (java.lang.String) (java.lang.String cannot be cast to com.google.appinventor.components.runtime.util.YailObject)

Many thanks for a response.
The next problems i will try to solve on my own again.

Thank you for your effort in this.

Best regards

1 Like

what kind of help do you expect without providing the full api?

What do you exactly mean with api?
What do you want to see at this point?

how do you get this json result? via url? if so just share with us a sample

Because your json structure is seems to be incomplete

1 Like

full api answer, not a piece of code

{
"icestats": {
"admin": "icemaster@localhost",
"banned_IPs": 0,
"build": 20220212051653,
"location": "AzuraCast",
"outgoing_kbitrate": 1502,
"server_id": "Icecast 2.4.0-kh15-ac1",
"server_start": "22/Jun/2022:00:36:01 +0200",
"stream_kbytes_read": 276807295,
"stream_kbytes_sent": 1353356646,
"source": [
{
"artist": "Andrew Spencer feat. 740 Boyz",
"audio_info": "channels=2;samplerate=44100;bitrate=96",
"bitrate": 96,
"connected": 5450975,
"genre": "Dance",
"incoming_bitrate": 97448,
"listener_peak": 14,
"listeners": 6,
"metadata_updated": "24/Aug/2022:02:44:27 +0200",
"outgoing_kbitrate": 558,
"queue_size": 98286,
"server_type": "audio/aac",
"stream_start": "22/Jun/2022:00:36:13 +0200",
"title": "Shimmy Shake 2k21 (Radio Edit)",
"total_mbytes_sent": 301886,
"yp_currently_playing": "Andrew Spencer feat. 740 Boyz - Shimmy Shake 2k21 (Radio Edit)"
},
{
"artist": "Andrew Spencer feat. 740 Boyz",
"audio_info": "channels=2;samplerate=44100;bitrate=320",
"bitrate": 320,
"connected": 5450975,
"genre": "Dance",
"incoming_bitrate": 325160,
"listener_peak": 17,
"listeners": 4,
"metadata_updated": "24/Aug/2022:02:44:27 +0200",
"outgoing_kbitrate": 937,
"queue_size": 539168,
"server_type": "audio/mpeg",
"stream_start": "22/Jun/2022:00:36:12 +0200",
"title": "Shimmy Shake 2k21 (Radio Edit)",
"total_mbytes_sent": 1020919,
"yp_currently_playing": "Andrew Spencer feat. 740 Boyz - Shimmy Shake 2k21 (Radio Edit)"
}
]
}
}

Parse block

add new variable “source”
Kodular Creator - Google Chrome 25-Aug-22 02_43_52

listview just for showing result

I will try this, thank you for your effort!