Today, I got help with integrating the Roblox Catalog API inserting 30 gears into my game, which is under the town and city genre. However, I’m encountering an issue now. I’m unable to change the genre byte successfully. Whenever I attempt to do so, either the same gears persist or they fail to appear altogether.
Script is:
local HttpService = game:GetService(“HttpService”)
local InsertService = game:GetService(“InsertService”)
local Players = game:GetService(“Players”)
local api = “https://catalog.roproxy.com/v1/search/items/details?Category=11&Subcategory=5&Genre=4&Limit=30”
local info = HttpService:GetAsync(api)
local decodedInfo = HttpService:JSONDecode(info)
local allPlayers = Players:GetPlayers()
local randomNumber = math.random(1, #allPlayers)
local randomPlayer = allPlayers[randomNumber]
for _, value in decodedInfo.data do
local GearModel = InsertService:LoadAsset(value.id)
local Gear = GearModel:FindFirstChildOfClass(“Tool”)
if Gear then
Gear.Parent = randomPlayer.Backpack
end
end
You can try this modification
local HttpService = game:GetService("HttpService")
local InsertService = game:GetService("InsertService")
local Players = game:GetService("Players")
local api = "https://catalog.roproxy.com/v1/search/items/details?Category=11&Subcategory=5&Genre=4&Limit=30"
local info = HttpService:GetAsync(api)
local decodedInfo = HttpService:JSONDecode(info)
local allPlayers = Players:GetPlayers()
local randomNumber = math.random(1, #allPlayers)
local randomPlayer = allPlayers[randomNumber]
for _, value in ipairs(decodedInfo.data) do
local GearModel = InsertService:LoadAsset(value.id)
local Gear = GearModel:FindFirstChildOfClass("Tool")
if Gear then
Gear.Parent = randomPlayer.Backpack
end
GearModel:Destroy() -- Destroy the GearModel after inserting the gear
end
1 Like
As far as I am aware genres are deprecated and their associated search parameters no longer work.
A quick google search seems to confirm this but you’ll have to look into it closer. Also as a quick tip, you can use a software like Postman to make working with APIs a lot easier.
Just did a bit more research on this and I found a forum post by Roblox Staff confirming that there currently is no way to search for things by genre, Upcoming Changes to Fields in CatalogAPI.
1 Like
Do you know why it’s not supported anymore?
I personally have no clue why. As far as I know there has never been a specific announcement stating the exact reasoning. Also from what I remember this change happened a long time ago so I doubt you’ll get much information on why this change was implemented in the first place.
1 Like
Will do, thanks. If it doesn’t work, I’ll need to research it further.
1 Like
One thing I’ve always been fascinated by is the Catalog Heaven GUI. How are you able to create that stuff? I’m trying to make my own catalog GUI using the Roblox API system, but now that it’s not supported anymore, I have no idea how to insert over 500 gears into my game.
1 Like
It’s going to take hours, if not weeks, to insert all the gears I need into the game and into the GUI.
1 Like
You can still fetch catalog items by type as far as I’m aware, just not by genre. Games like Catalog Haven probably don’t save all of the items you can get inside of the game itself and instead use the InsertService to dynamically load items into the game when needed.