Hey developers! This might sound weird, but I am wondering if there is some sort of Http request that returns a picture of a random bug / insect. I do not need it to be used in rbxassetid://. This might be the most random request but I tried looking for any but I have failed to find any that would work. Another solution I am willing to work with is if there is any free generative AI imaging Text-to-image API however, all I need is something that returns an image of a bugs / insects…
Any help is much appreciated, I have and still am looking for a solution !
I mean that is certainly a solution. I would rather, and prefer a generation, or an api to look for them, and or just an api that just has a huge library to pick from already. But I mean if that is not an option I may have to do that. I appreciated your help though!
Sorry for the late reply. I have been trying things for the past 2 hours, trying various solution and handling failures.
By doing something like this, I was able to make it work with just a Access key of an appilication.
For anyone Curious on how I did it, this was my code (With my Access key removed for obvious reasons)
local function GetABugPicture()
local FailCount = 3
local BugImage = nil
repeat
local BugURL = "https://api.unsplash.com/search/photos?query=insects-and-bugs&page="..math.random(1,300).."&per_page=100&client_id=ACCESSKEYHERE"
local httpResult
local success, errors = pcall(function()
httpResult = httpsService:GetAsync(BugURL)
end)
if success then
local Buglist = httpsService:JSONDecode(httpResult)
if Buglist["total"] >= 1 then
BugImage = Buglist["results"][math.random(1, #Buglist["results"])]["urls"]["full"]
end
end
FailCount -= 1
until FailCount <= 0 or BugImage ~= nil
return BugImage
end
print(GetABugPicture())
Thank you so much for your help! I will do appreciate it!