How can I loop through all of the user's tshirts that they put up for sale?

local http = game:GetService("HttpService")

local baseUrl = "https://catalog.roproxy.com/v1/search/items/details?Category=3&Subcategory=13&Limit=30&CreatorName=%s&cursor=%s"

local function getUserGeneratedTShirtsRecursive(username, tshirts, cursor)
	tshirts = tshirts or {}
	cursor = cursor or ""
	local requestUrl = baseUrl:format(username, cursor)
	local success, result = pcall(function()
		return http:GetAsync(requestUrl)
	end)
	
	if success then
		if result then
			local success2, result2 = pcall(function()
				return http:JSONDecode(result)
			end)
			
			if success2 then
				if result2 then
					for _, tshirt in ipairs(result2.data) do
						table.insert(tshirts, tshirt.id)
					end
					
					cursor = result2.nextPageCursor
					if cursor then
						return getUserGeneratedTShirtsRecursive(username, tshirts, cursor)
					else
						return tshirts
					end
				end
			else
				warn(result)
			end
		end
	else
		warn(result)
	end
end

local username = "Roblox"
local userTShirts = getUserGeneratedTShirtsRecursive(username)
print(#userTShirts) --3
print(table.concat(userTShirts, " ")) --1031862 1036727 1031864

When testing the same script with a user that has uploaded more than 30 t-shirts (maximum page-size per request) these were the results.

local username = "robosapien626"
local userTShirts = getUserGeneratedTShirtsRecursive(username)
print(#userTShirts) --323
print(table.concat(userTShirts, " ")) --323 shirt IDs.
17 Likes