I use HttpService to request audio searches for players to find audio to play on their radios. I use a proxy since Roblox.com does not allow requests. Other categories like image search, plugin search, and model search work, but audio search does not, and returns an empty table. It does not produce an error. This was first discovered on 6/23/23.
MusicSearchFunction.OnServerInvoke = function(player,input)
local Songs = {}
local Repeated = 0
repeat
Songs = {}
Repeated = Repeated+1
local success, msg = pcall(function()
local Request = HttpService:GetAsync("https://search.roproxy.com/catalog/json?CatalogContext=2&Category=9&Keyword="..input)
print(Request)
local RequestTable = HttpService:JSONDecode(Request)
print(RequestTable)
for i,Audio in ipairs(RequestTable) do
if Audio.IsThumbnailUnapproved == false and table.find(RemovedAssets,Audio.Description) == nil then
table.insert(Songs,{Audio.Name,Audio.AssetId})
end
end
end)
if not success then
task.wait(3)
end
until success or Repeated == 3
return Songs
end
Output:
[]
{}
Expected behavior
I expect to get a table of the audio search when I decode the Http request.
The audio search API is unique in that it requires authentication in order to get results. You can verify this for yourself by opening https://search.roblox.com/catalog/json?Category=9 on a signed in window, and in an incognito window (to act as signed out).