How can I filter text with a web API?

Hi!

I have a simple question I’ve been trying to solve for a while. So I’m making a website for my Roblox plugin where users will be able to share their creations. The plugin will fetch data from the website, but I need to make sure that the data is text filtered.

Is there a way I can filter text outside of Roblox with an api?

I found this: https://textfilter.roblox.com/docs but it is under maintenance.

Any help would be appreciated!

1 Like

Have you tried using the textfilter api, even tho it looks like it’s under maintence? It might not be, you won’t know until you try!

An alternative from roblox’s text filtering api (specifically for your website) would be PurgoMalum.

1 Like

I haven’t because I don’t know how to. Do you know how to use the api?

1 Like

Yep, I’m testing that right now, but I still think the safest way is to use roblox text filter.

1 Like

It sounds like the best idea would be to have them upload it to the marketplace so that Roblox can deal with the moderation.

You can try requesting the user of the plugin to play the game to see the creations then use the TextService filtering.

You can do this by accessing TextService, and then you can filter text using TextService:FilterStringAsync().

Sadly that isn’t really an option. I want to make it so they can discover other stuff made by others directly from the plugin.

1 Like

My goal is to filter the text on the website, on the server. I’m trying to avoid filtering it in the plugin to avoid bypasses.
That’s why I’m looking for a good web api.

1 Like

I think this might be the solution for you, Can you achieve filtering for plugins? - #4 by ReturnedTrue

I’ve already came across this but it has a problem. Using this api can lead to moderation action and if you are not logged in to roblox it does not work.

Thanks for the help though!

1 Like

Other than that there is no real way to achieve that. You can try to reproduce the roblox filter using their provider TwoHat.

Hi!

I think the issue is solved.

So basically the website will have it’s own text filter (www.purgomalum.com) for safety.
To avoid issues, when the plugin fetches data from the website, it will filter the text on client side with the Roblox chat filter.
Of course if someone changes the code of the plugin to remove that filter just to see some unfiltered text, that’s not my problem so I don’t think I can get in trouble.

Thanks for the help, everyone!

EDIT: I just realized that the text filter does not work in Studio, so I can’t filter the text with the plugin. I think I’ll just use PurgoMalum for text filtering. If anyone knows how to filter text with a plugin, please reply!

1 Like

Hello!

I’m pretty sure that TwoHat is a paid service and I can’t really pay for it now. Thanks for the help tho!

2 Likes

Dude thanks for this reply…

local function containsProfanity(text)
	local url = "https://www.purgomalum.com/service/containsprofanity?text=" .. text
	local response = HTTPService:GetAsync(url, true)

	return response == "true"
end

if containsProfanity(inputText) then
    TranslateRequestEvent:FireClient(player, "Censored")
	return
end

My basic usage.

1 Like