Roproxy url "table expected, got string"

any help is much appreciated🤟
im using this >> External Catalog Queries | Roblox Creator Documentation
it says “table expected, got string” in da output. im not sure whats wrong with the url

local url = "https://search.roproxy.com/catalog/json?CatalogContext=2&Category=9&SortType=0&Keyword="..Text -- the Text is the inputed text in a textbox sent over from the local script through a remote event
local result = httpservice:GetAsync(url)

the whole script just in case anyone wants to see it for future reference >>

local event = game.ReplicatedStorage.RemoteEvents.UpdateSearch
local httpservice = game:GetService("HttpService")

event.OnServerEvent:Connect(function(player,Text) -- the inputed text from the textbox sent over through a remote event
	
	print(Text) -- just for testing
	
	local musicgui = player.PlayerGui.PopUps.Phone.Screen.Music

	local url = "https://search.roproxy.com/catalog/json?CatalogContext=2&Category=9&SortType=0&Keyword="..Text -- url but instead of https://search.roblox.com/catalog/json?... its https://search.roproxy.com/catalog/json? because you cant use https service directly with the roblox catalog
	local result = httpservice:GetAsync(url) -- get the returned table

	for _,song in ipairs(result) do
		
		print(song.Name)
		
		local banner = game.ReplicatedStorage.BearChat.Song:Clone() -- the banner is the frame that is cloned into the scrolling frame
		banner.Parent = musicgui.SearchQuery
		banner.Id.Value = song.AssetId
		banner.Artist.Text = song.Creator
		banner.Title.Text = song.Name
	end
end)
1 Like

what does it print when u print song.Name after the loop?

2 Likes

you mean like after the first end? it doesn’t work because the url doesnt work in the first place

1 Like

i mean this one what shows in the output?

2 Likes

it doesn’t work because the url doesnt work in the first place

1 Like

try to print result before this loop and show me the output

2 Likes

this is the output for “hey” and thank you so much for your help btw i feel like im finally getting somewhere with my music system and im so happy

1 Like

hmmmm that’s why this is happening I assume your trying to make a music system , I’m not actually that experience in httpservice but i don’t think its a good idea to get the whole music link from roblox it self because as u can see that what u will get but there is another easy way to make it works, add a sound and whenever the player paste an id put that id in the sound and check if that id is valid or not then after that u can play the sound

2 Likes

ya a lot of games do that but i wanna go the extra mile and make it easier for players to find songs like the music system in meepcity or work at a pizza place thank for all your help tho

2 Likes

You need to pass result through httpservice:JSONDecode(). This will convert it from a string into a table that ipairs() can iterate through.

2 Likes