Username checker template
- Node.js
- Express
Block offensive usernames at signup, including profanity hidden inside a longer name.
A Node.js and Express app that checks a username for profanity before someone can claim it. Type a username and it tells you whether it’s clean or offensive, even when the word is buried in a longer name with numbers or underscores. Try names by hand, or call the route from your signup form.

What it does
- Finds hidden profanity
- Catches offensive words inside longer usernames, like a slur followed by numbers.
- One yes-or-no answer
- Returns a simple flag, so your signup form can accept the name or ask for another.
- Keeps your key private
- The page calls your own server, which holds the key and limits each visitor to 10 checks a minute.
How it works
The route that checks a username.
// GET /api/check?username=
app.get('/api/check', async (req, res) => {
const username = str(req.query.username, 64);
if (!username) return res.status(400).json({ error: 'Enter a username.' });
try {
const data = await callApi('usernameprofanity', { query: { username } });
res.json({ success: true, username: data.username, isProfane: data.isProfane });
} catch (err) {
res.status(err.status || 502).json({ error: err.message });
}
});Deploy it
- Get a free API key
The free plan includes 200 credits a month, no card needed. Create your key.
- Deploy it
Click Deploy to Vercel. Vercel copies the repo to your GitHub account and asks for
APIVERVE_API_KEY: paste your key there. - Open your app
Vercel builds it and gives you a live URL, usually in about a minute. Every push to the repo redeploys it.
Try the Username Profanity API — the call this template makes
No key required to try it. Get a key to use it in your app.
{
"status": "ok",
"error": null,
"data": {
"username": "b00bs",
"isProfane": true
}
}