https://github.com/apiverve/content-moderator-node-tutorial
Content moderation tool for filtering profanity built with Node.js
https://github.com/apiverve/content-moderator-node-tutorial
apiverve content-moderation express moderation nodejs profanity-filter text-filtering tutorial
Last synced: about 6 hours ago
JSON representation
Content moderation tool for filtering profanity built with Node.js
- Host: GitHub
- URL: https://github.com/apiverve/content-moderator-node-tutorial
- Owner: apiverve
- License: mit
- Created: 2026-02-16T06:22:58.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-02-16T07:40:23.000Z (4 months ago)
- Last Synced: 2026-02-16T14:17:12.816Z (4 months ago)
- Topics: apiverve, content-moderation, express, moderation, nodejs, profanity-filter, text-filtering, tutorial
- Language: HTML
- Homepage: https://apiverve.com/marketplace/profanityfilter
- Size: 17.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Content Moderator | APIVerve API Tutorial
[](LICENSE)
[]()
[](https://nodejs.org)
[](https://expressjs.com)
[](https://apiverve.com/marketplace/profanityfilter?utm_source=github&utm_medium=tutorial&utm_campaign=content-moderator-node-tutorial)
A Node.js web app for filtering profanity from user-generated content. Perfect for moderating comments, chat messages, and user submissions.

---
### Get Your Free API Key
This tutorial requires an APIVerve API key. **[Sign up free](https://dashboard.apiverve.com?utm_source=github&utm_medium=tutorial&utm_campaign=content-moderator-node-tutorial)** - no credit card required.
---
## Features
- Filter profanity from any text input
- Customizable mask character (*, #, etc.)
- Shows filtered result and flagged words
- Clean/Flagged status indicator
- Count of profane words found
- Modern, responsive UI
- Built with Express.js
## Quick Start
1. **Clone this repository**
```bash
git clone https://github.com/apiverve/content-moderator-node-tutorial.git
cd content-moderator-node-tutorial
```
2. **Install dependencies**
```bash
npm install
```
3. **Add your API key**
Set environment variable or edit `server.js`:
```bash
export API_KEY=your-api-key-here
```
4. **Start the server**
```bash
npm start
```
5. **Open in browser**
Visit http://localhost:3000 and test the moderator!
## Project Structure
```
content-moderator-node-tutorial/
├── server.js # Express server & API endpoint
├── public/
│ └── index.html # Frontend UI
├── package.json # Dependencies
├── screenshot.jpg # Preview image
├── LICENSE # MIT license
├── .gitignore # Git ignore rules
└── README.md # This file
```
## How It Works
1. User enters text in the web interface
2. Frontend sends POST request to `/api/moderate`
3. Server calls the Profanity Filter API
4. API returns filtered text and flagged words
5. Frontend displays results with status
### The API Call
```javascript
const response = await fetch('https://api.apiverve.com/v1/profanityfilter', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': API_KEY
},
body: JSON.stringify({
text: 'Text to moderate',
mask: '*'
})
});
```
## API Reference
**Endpoint:** `POST https://api.apiverve.com/v1/profanityfilter`
**Request Body:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `text` | string | Yes | Text to filter |
| `mask` | string | No | Character to replace profanity (default: *) |
**Example Response:**
```json
{
"status": "ok",
"error": null,
"data": {
"isProfane": true,
"filteredText": "Today is so **** hot! Why the **** would anyone go outside?",
"mask": "*",
"trimmed": false,
"profaneWords": 2
}
}
```
## Use Cases
- **Comment moderation** - Filter user comments before posting
- **Chat applications** - Real-time message filtering
- **User profiles** - Validate usernames and bios
- **Reviews** - Clean up product/service reviews
- **Forums** - Moderate discussion posts
- **Gaming** - Filter in-game chat
## Customization Ideas
- Add batch processing for multiple texts
- Save moderation history to database
- Add different severity levels
- Implement allow/block lists
- Add real-time filtering as you type
- Build a moderation dashboard with statistics
## Related APIs
Explore more APIs at [APIVerve](https://apiverve.com/marketplace?utm_source=github&utm_medium=tutorial&utm_campaign=content-moderator-node-tutorial):
- [Spam Detector](https://apiverve.com/marketplace/spamdetector?utm_source=github&utm_medium=tutorial&utm_campaign=content-moderator-node-tutorial) - Detect spam content
- [Sentiment Analysis](https://apiverve.com/marketplace/sentimentanalysis?utm_source=github&utm_medium=tutorial&utm_campaign=content-moderator-node-tutorial) - Analyze text sentiment
- [Content Filter](https://apiverve.com/marketplace/contentfilter?utm_source=github&utm_medium=tutorial&utm_campaign=content-moderator-node-tutorial) - Advanced content filtering
## Free Plan Note
This tutorial works with the free APIVerve plan. Some APIs may have:
- **Locked fields**: Premium response fields return `null` on free plans
- **Ignored parameters**: Some optional parameters require a paid plan
The API response includes a `premium` object when limitations apply. [Upgrade anytime](https://dashboard.apiverve.com/plans) to unlock all features.
## License
MIT - see [LICENSE](LICENSE)
## Links
- [Get API Key](https://dashboard.apiverve.com?utm_source=github&utm_medium=tutorial&utm_campaign=content-moderator-node-tutorial) - Sign up free
- [APIVerve Marketplace](https://apiverve.com/marketplace?utm_source=github&utm_medium=tutorial&utm_campaign=content-moderator-node-tutorial) - Browse 300+ APIs
- [Profanity Filter API](https://apiverve.com/marketplace/profanityfilter?utm_source=github&utm_medium=tutorial&utm_campaign=content-moderator-node-tutorial) - API details