Welcome to Masker. This guide will help you integrate PII redaction into your applications.
Masker is designed to be dead simple. You send text, we return purged text.
import requests
url = "https://masker-api.p.rapidapi.com/v1/redact"
payload = {
"text": "Hello, my name is John Smith and my email is john.smith@example.com",
"mode": "mask", # mask (***), placeholder (<EMAIL>), or redact ([REDACTED])
"language": "en"
}
headers = {
"content-type": "application/json",
"X-RapidAPI-Key": "YOUR_API_KEY",
"X-RapidAPI-Host": "masker-api.p.rapidapi.com"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())Output:
{
"text": "Hello, my name is *** and my email is ***",
"entities": [
{
"type": "PERSON",
"original": "John Smith",
"redacted": "***",
"start": 18,
"end": 28
},
{
"type": "EMAIL",
"original": "john.smith@example.com",
"redacted": "***",
"start": 45,
"end": 67
}
],
"processing_time_ms": 12
}Customize how sensitive data is handled using the mode parameter:
| Mode | Description | Example Output | Best For |
|---|---|---|---|
mask |
Replaces characters with *** |
Contact *** at *** |
Clean reading, UI display |
placeholder |
Replaces with entity type tag | Contact <PERSON> at <EMAIL> |
LLM training, analytics |
redact |
Replaces with [REDACTED] |
Contact [REDACTED] at [REDACTED] |
Legal compliance, logs |
Masker isn't just for flat text. You can send complex nested JSON objects, and we'll walk the tree to sanitize every string value.
Input:
{
"user": {
"name": "Jane Doe",
"metadata": {
"ip": "192.168.1.1",
"note": "Call her at +1-555-0199"
}
}
}Output:
{
"user": {
"name": "***",
"metadata": {
"ip": "192.168.1.1",
"note": "Call her at ***"
}
}
}Note: Keys (name, metadata) are never touched. Only values are processed.
We automatically detect the following entities:
EMAIL- Email addressesPHONE- International phone numbersCARD- Credit and debit card number candidates detected with regexPERSON- Person-name candidates detected with spaCy NER
You can restrict detection to specific types using the entities array:
{
"text": "Call John at 555-0199",
"entities": ["PHONE"] // Will NOT redact "John"
}- Payload Size: Requests are validated against the service's configured text and payload limits.
- Concurrency: Stateless architecture scales horozontally. Contact us for custom enterprise limits.
- Stateless: We do not store your data. Period.
- SSL/TLS: All traffic is encrypted in transit.
- No Training: Your inputs are never used to train our models.
Contact us at support@kikuai.dev or visit kikuai.dev for more tools.