Trouble in converting json to Dictionary

So guys,
I have a problem with converting json to dictionary.
I’m trying to get data from an api (rapidapi google search api ‘image’ method)
I want to get the image link and it’s title
So, Related Blocks below.

Blocks

Also tried this block :

Error

Json Image

These I want
So pls help guys :slight_smile: :smiley:

Hello guys, anyone help me

@Still-learning , @Midhlaj_am , @netsolutions1

The blocks seem good to me, what if you try using @Mohamed_Tamer’s extension to convert json text to dictionary? I have faced similar cases before where json is decoded wrongly.

The extension:

See my bug report here:

1 Like

Have you tried like this,?
image

organic-result = image_results

title(no change)
replace url with src
create new blocks for image

2 Likes

The issue with your blocks is that you are trying to access “images” key from a list and not a dictionary.

  • Arrow should point a bit down :sweat_smile:
1 Like

Not working :sob:

Tnx, I will check :grin:

So, what I will change for the solution :innocent::innocent::innocent:

1 Like

I think there is a bug for “walk all at level” block.
You can do like this:

I found two problems.

  1. The image doesn’t convert json to dictionary correctly.
The sample json i made:
{
	"image_result": [
		{
			"image":{
				"src":"https://google.com",
				"alt":""
			},
			"link":{
				"href":"https://google.com/href",
				"title":"hello",
				"domain":"google.com"
			}
		},
		{
			"image":{
				"src":"https://google.com",
				"alt":""
			},
			"link":{
				"href":"https://google.com/href",
				"title":"hello",
				"domain":"google.com"
			}
		},
		{
			"image":{
				"src":"https://google.com",
				"alt":""
			},
			"link":{
				"href":"https://google.com/href",
				"title":"hello",
				"domain":"google.com"
			}
		},
		{
			"image":{
				"src":"https://google.com",
				"alt":""
			},
			"link":{
				"href":"https://google.com/href",
				"title":"hello",
				"domain":"google.com"
			}
		}
	]
}

The converted result:

You need to use the JsonToDictionary extension for now.

  1. After correctly converting, I found that adding one more “walk all at level” to the list actually works.

image

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