How to get a Table of Catolog Items?

I’m trying to add shirts to an avatar editor I found, but I need a reliable way to get a table of shirts. This is the script I tried:

local Http = game:GetService("HttpService")

local subcategory = 11
local url = "https://search.roblox.com/catalog/json?Subcategory=" .. subcategory .. "&IncludeNotForSale=true&ResultsPerPage=60&PageNumber="

local pages = 25

local assets = {}

for i = 1, pages do
	local urlPage = url .. i
	local data = Http:JSONEncode(Http:GetAsync(urlPage))
	data = Http:JSONDecode(data)

	for ii = 1, #data do
		local asset = data[ii]

		local id = asset.AssetId
		local name = asset.Name

		assets[#assets + 1] = "{Id = " ..id .. ", Name = \"" .. name .. "\"}"
	end
	print(i)
end

It wouldn’t let me print the data.

You have to add a sort type to this for it to show results. For instance, I’ll use 2 as the sort type (Best Selling).

"https://search.roblox.com/catalog/json?Subcategory=" .. subcategory .. "&IncludeNotForSale=true&ResultsPerPage=60&SortType=2&PageNumber="
1 Like

I get the error “Trust check failed” every time.

1 Like