Json data extract

hey all i was trying to extract a specific part from a json data but i am unable to do it

json data :-

{
“kind”: “youtube#searchListResponse”,
“etag”: “WCgyqo_rJnTjRCTvkFqHdBxk6WE”,
“nextPageToken”: “CAUQAA”,
“regionCode”: “IN”,
“pageInfo”: {
“totalResults”: 1000000,
“resultsPerPage”: 5
},
“items”: [
{
“kind”: “youtube#searchResult”,
“etag”: “6VseK9iKSJuahByifXt6PzESqOE”,
“id”: {
“kind”: “youtube#video”,
“videoId”: “u2TU0_aW2eY”
},
“snippet”: {
“publishedAt”: “2013-06-11T02:32:46Z”,
“channelId”: “UC3kjTskNog1CgSNul7qwHVA”,
“title”: “Manipuri song Ho Leishabi Bala And Soma”,
“description”: “”,
“thumbnails”: {
“default”: {
“url”: “https://i.ytimg.com/vi/u2TU0_aW2eY/default.jpg”,
“width”: 120,
“height”: 90
},
“medium”: {
“url”: “https://i.ytimg.com/vi/u2TU0_aW2eY/mqdefault.jpg”,
“width”: 320,
“height”: 180
},
“high”: {
“url”: “https://i.ytimg.com/vi/u2TU0_aW2eY/hqdefault.jpg”,
“width”: 480,
“height”: 360
}
},
“channelTitle”: “Ved Takhel”,
“liveBroadcastContent”: “none”,
“publishTime”: “2013-06-11T02:32:46Z”
}
},
{
“kind”: “youtube#searchResult”,
“etag”: “gU5atSofKiAj1Ss3ecw1chdCPWo”,
“id”: {
“kind”: “youtube#video”,
“videoId”: “ifjSM8knNyE”
},
“snippet”: {
“publishedAt”: “2019-10-21T06:17:00Z”,
“channelId”: “UCW01vmM4gJux-KkXKWywyLg”,
“title”: “Best Song of Oct 2019 | Bala Bala Shaitan ka Sala”,
“description”: “Best Song of Oct 2019 | Bala Bala Shaitan ka Sala #Balabalasong #Sahitankasala #abhijeetmeshram My Website Hosting Partner:- …”,
“thumbnails”: {
“default”: {
“url”: “https://i.ytimg.com/vi/ifjSM8knNyE/default.jpg”,
“width”: 120,
“height”: 90
},
“medium”: {
“url”: “https://i.ytimg.com/vi/ifjSM8knNyE/mqdefault.jpg”,
“width”: 320,
“height”: 180
},
“high”: {
“url”: “https://i.ytimg.com/vi/ifjSM8knNyE/hqdefault.jpg”,
“width”: 480,
“height”: 360
}
},
“channelTitle”: “Abhijeet Meshram”,
“liveBroadcastContent”: “none”,
“publishTime”: “2019-10-21T06:17:00Z”
}
},
{
“kind”: “youtube#searchResult”,
“etag”: “_Yk1aIe9e7FaDr3V-7W-C9_k_Ok”,
“id”: {
“kind”: “youtube#video”,
“videoId”: “Bj_xaltfmEU”
},
“snippet”: {
“publishedAt”: “2019-10-25T06:57:06Z”,
“channelId”: “UC56gTxNs4f9xZ7Pa2i5xNzg”,
“title”: “Naah Goriye -Bala | Ayushmann Khurrana | Harrdy Sandhu | Swasti Mehul |B Praak | Jaani | Sonam Bajwa”,
“description”: “Catch a glimpse of the side of Bala in Naah Goriye ! Ayushmann Khurrana absolutely slays us with moves accompanied by the uber talented Harrdy …”,
“thumbnails”: {
“default”: {
“url”: “https://i.ytimg.com/vi/Bj_xaltfmEU/default.jpg”,
“width”: 120,
“height”: 90
},
“medium”: {
“url”: “https://i.ytimg.com/vi/Bj_xaltfmEU/mqdefault.jpg”,
“width”: 320,
“height”: 180
},
“high”: {
“url”: “https://i.ytimg.com/vi/Bj_xaltfmEU/hqdefault.jpg”,
“width”: 480,
“height”: 360
}
},
“channelTitle”: “Sony Music India”,
“liveBroadcastContent”: “none”,
“publishTime”: “2019-10-25T06:57:06Z”
}
},
{
“kind”: “youtube#searchResult”,
“etag”: “F9AvwWTTmUIYZ7cNlfuzdrWUX0c”,
“id”: {
“kind”: “youtube#video”,
“videoId”: “6aFWjMeCuoc”
},
“snippet”: {
“publishedAt”: “2020-04-15T03:08:53Z”,
“channelId”: “UCwRLhkSLS9c5OkxlU4H2LmA”,
“title”: “Housefull 4 - Shaitan Ka Saala (Full Video Song) | Akshay Kumar | Bala Bala”,
“description”: “Mera New Channel Me Giveway Ho Raha Hai Agar Aap Mere Youtube Channel Ko Subscribe Kar Lete Hai To Aap Bhi participate Kar Sakte Hai Bas Apako …”,
“thumbnails”: {
“default”: {
“url”: “https://i.ytimg.com/vi/6aFWjMeCuoc/default.jpg”,
“width”: 120,
“height”: 90
},
“medium”: {
“url”: “https://i.ytimg.com/vi/6aFWjMeCuoc/mqdefault.jpg”,
“width”: 320,
“height”: 180
},
“high”: {
“url”: “https://i.ytimg.com/vi/6aFWjMeCuoc/hqdefault.jpg”,
“width”: 480,
“height”: 360
}
},
“channelTitle”: “YT Shorts Video”,
“liveBroadcastContent”: “none”,
“publishTime”: “2020-04-15T03:08:53Z”
}
},
{
“kind”: “youtube#searchResult”,
“etag”: “ko1s11OBkSQSwEvT_Etxnz20zJQ”,
“id”: {
“kind”: “youtube#video”,
“videoId”: “lFCfqxMk7TY”
},
“snippet”: {
“publishedAt”: “2020-04-20T17:58:44Z”,
“channelId”: “UCt5myrD4zpdIgriDxmN0UmA”,
“title”: “Bala Song | Bala Bala | Bala Bala Song | Bala Parody | Bala Bala Shaitan Ka Saala | Parody Song”,
“description”: “Bala Song - “Bala Bala Shaitan Ka Sala”: Bala is at home due to CoronaVirus and he doesn’t like it. Puzzilla presents Bala Song: Shaitan Ka Saala Bala singing …”,
“thumbnails”: {
“default”: {
“url”: “https://i.ytimg.com/vi/lFCfqxMk7TY/default.jpg”,
“width”: 120,
“height”: 90
},
“medium”: {
“url”: “https://i.ytimg.com/vi/lFCfqxMk7TY/mqdefault.jpg”,
“width”: 320,
“height”: 180
},
“high”: {
“url”: “https://i.ytimg.com/vi/lFCfqxMk7TY/hqdefault.jpg”,
“width”: 480,
“height”: 360
}
},
“channelTitle”: “Puzzilla”,
“liveBroadcastContent”: “none”,
“publishTime”: “2020-04-20T17:58:44Z”
}
}
]
}

the part that i want to extract :point_down:

“videoId”: “u2TU0_aW2eY”

You can find this part in the data by ctrl+f

my code :

image

i may be wrong as i am not too good in json

and the url is correct , it contained my api key so i hide it

First of all a good site that will help you first to validate and then to understand json’s stucture is jsonparseronline

Then you can work with dictionary blocks like … I had to modify json a little bit so check that the response you get from api is a valid json

4 Likes

@dora_paz thanks for your help :slight_smile:

As I said check response from api if is a valid json

1 Like

i am using youtube v3 api

@dora_paz hey I tried to correct my code , I ended up with this
image
it’s still not working can you figure out the mistake
I used JSON tools extension

I found dictionaries a bit confusing and complicated

@dora_paz please help me , I need your help :pray:t3:

First you have to Parse JSON data

I don’t think begging for help is the best way to learn. I still can’t understand what beginning users really want.
Here in the community there are hundreds of posts about Json.

1 Like

A good example can be found here

2 Likes

I saw each and every post on the community but I was still not able to do what I wnat

In This topic, There is Json example And blocks.

1 Like

Try this, using both JsonUtils & JsonTools extension

1 Like

and if i want to get only the first videoid and not others

@dora_paz can you share JsonUtils aix

Then select list item list block at index … afterwards or if you know the index

1 Like

Link

2 Likes

@dora_paz i did the same thing but this error came

It means your key items is not found

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.