How do I Convert Http Image Result to Image Ids

Hello Developers,

I am trying to get images from the Roblox Marketplace and I want to return image Ids. But I have a problem, I have no fricken idea what the hell I’m doing.

I’m requesting data using this URL: https://apis.roproxy.com/toolbox-service/v1/marketplace/13?limit=30&pageNumber=0&keyword= and it’s returning this data:

{"totalResults":1000,"filteredKeyword":"","searchDebugInfo":null,"spellCheckerResult":{"correctionState":0,"correctedQuery":null,"userQuery":null},"queryFacets":{"appliedFacets":[],"availableFacets":[]},"imageSearchStatus":null,"previousPageCursor":null,"nextPageCursor":"MV8xXzFfMzA=_fd53e9ac991abb9e1f401b7854bef2dd","data":[{"id":6673968185,"name":null},{"id":15011943566,"name":null},{"id":15694319414,"name":null},{"id":5923741533,"name":null},{"id":16661150541,"name":null},{"id":16587156194,"name":null},{"id":15485945012,"name":null},{"id":14580252561,"name":null},{"id":7019310898,"name":null},{"id":2592714573,"name":null},{"id":14523656696,"name":null},{"id":10198213131,"name":null},{"id":5997171506,"name":null},{"id":15668607705,"name":null},{"id":14765960892,"name":null},{"id":1754035854,"name":null},{"id":7472398570,"name":null},{"id":5484695722,"name":null},{"id":9913176040,"name":null},{"id":12819227460,"name":null},{"id":5009915812,"name":null},{"id":14155397177,"name":null},{"id":9180622670,"name":null},{"id":9605261863,"name":null},{"id":16550474140,"name":null},{"id":14999333458,"name":null},{"id":4632517063,"name":null},{"id":11739751536,"name":null},{"id":16462165784,"name":null},{"id":16429048890,"name":null}]}

I thought I could just do Result.data but that doesn’t work. (Womp womp)

Here's the full code
-- // Services // --
local HttpService = game:GetService("HttpService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

-- // GET // --
local function GETImagesByKeyword(KeyWord, PageNumber)
	
	-- Locals
	local RequestingURL = "https://apis.roproxy.com/toolbox-service/v1/marketplace/13?limit=30&pageNumber="..PageNumber.."&keyword="
	
	local Result
	
	local Success, Error = pcall(function()
		Result = HttpService:GetAsync(RequestingURL..tostring(KeyWord))
	end)
	
	if not Success then
		warn("Error getting images | Error Message: "..Error)
	end
	
	return Result
	
end

print(GETImagesByKeyword("", 0))
1 Like

Update: All I did was HttpService:JSONDecode(Result).data. It works now.

2 Likes

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