PII Masker
Detect and redact PII — emails, phone numbers, SSNs, credit cards, and IPs
/v1/text/mask
curl -X POST "https://textanalysis.toolkitapi.io/v1/text/mask" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Contact Jane at [email protected] or call 555-867-5309.", "mask_char": "*"}'
import httpx
resp = httpx.post(
"https://textanalysis.toolkitapi.io/v1/text/mask",
json={"text": "Contact Jane at [email protected] or call 555-867-5309.", "mask_char": "*"},
)
print(resp.json())
const resp = await fetch("https://textanalysis.toolkitapi.io/v1/text/mask", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"text": "Contact Jane at [email protected] or call 555-867-5309.", "mask_char": "*"}),
});
const data = await resp.json();
console.log(data);
# See curl example
{
"masked_text": "Contact Jane at ***************** or call ************.",
"entities": [
{"type": "email", "original": "[email protected]", "start": 16, "end": 32},
{"type": "phone", "original": "555-867-5309", "start": 43, "end": 55}
],
"entity_count": 2
}
Try It Live
Description
How to Use
1. Send a POST request to `/v1/text/mask` with the `text` to sanitise. 2. Optionally set `mask_char` to change the replacement character (default: `*`). 3. Pass `entity_types` to limit detection to specific PII types: `email`, `phone`, `ssn`, `credit_card`, `ipv4`, `date_of_birth`. 4. Use `masked_text` as the sanitised output; inspect `entities` to see what was redacted.
About This Tool
The PII Masking endpoint detects and redacts personally identifiable information from text. It identifies emails, US phone numbers, Social Security Numbers, credit card numbers, IPv4 addresses, and dates of birth — replacing them with a configurable mask character.
The response reports exactly what was found and replaced, including character offsets for each match. The API is fully stateless — text is processed in-memory and never stored.
Why Use This Tool
- Log sanitisation — Strip PII from application logs before writing to centralised logging
- GDPR compliance — Anonymise user-submitted content before storage
- Support ticket processing — Mask customer data before routing to third-party tools
- AI pipeline pre-processing — Remove PII before sending text to an LLM or vector store
Start using PII Masker now
Get your free API key and make your first request in under a minute.