PII Shield API reference
One deterministic pass over a piece of text that tells you what personal data it contains, what to replace, how abusive it is and how spammy it looks.
Detect: 19 detectors - email, phone, payment cards (Luhn), IBAN (mod-97), US SSN, IPv4/IPv6, URL, birth dates, passport and licence numbers (label driven), postal addresses, person names (dictionary heuristic), API keys (entropy heuristic), JWTs, crypto wallets (base58check verified), MAC addresses, GitHub tokens and AWS key ids. Findings carry a 0-1 confidence and never overlap.
Redact: three styles. Mask keeps the last N characters, label emits stable [EMAIL_1] tokens per distinct value, hash emits [EMAIL_xxxxxxxx] from the first 8 hex characters of the value's SHA-256 so identical values correlate across documents.
Screen: a four language profanity lexicon (en, es, fr, de) that undoes leetspeak, repeated letters and single-character separators, plus an 11 signal spam score with the points and evidence behind every signal.
Limits, stated plainly: detection is regex plus checksum plus small dictionaries. It will miss unusual formats (spaced-out card numbers, names outside the dictionary, non-Latin scripts) and it cannot know whether a string is personal data without context - a bare date is reported at confidence 0.5 unless a birth keyword is nearby. Passport, licence and street addresses need their usual labels. No ML model, no data leaves the edge, no upstream calls: identical input always returns identical output.
Built for: LLM prompt sanitisers, customer support desks, log pipelines, UGC platforms, GDPR/SOC2 evidence runs.
Auth
Two headers on every call. The marketplace rejects requests without them before they reach the API.
X-RapidAPI-Key: YOUR_KEY
X-RapidAPI-Host: piishield.p.rapidapi.com
Errors
Every failure returns the same envelope, with a requestId you can quote to support.
{ "error": { "code": "INVALID_INPUT", "message": "...", "hint": "..." }, "requestId": "uuid", "timestamp": "ISO-8601" }
6 endpoints
Detect personal data and secrets in free text
Runs every requested detector over the text and returns non-overlapping findings sorted by offset, counts per detector, merged replacement spans and a 0-100 risk summary. Checksum backed detectors (Luhn, IBAN mod-97, base58check) only report values that pass their check; heuristics such as PERSON_NAME and API_KEY report confidence below 0.6. Maximum 2,000 findings per response.
Request body
{
"text": "Card 4111 1111 1111 1111, SSH from 203.0.113.42, key AKIAIOSFODNN7EXAMPLE.",
"types": [
"EMAIL",
"CREDIT_CARD"
],
"minConfidence": 0.6
}
curl example
curl -s -X POST 'https://piishield.ayamk.in/v1/scan' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: piishield.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{"text": "Card 4111 1111 1111 1111, SSH from 203.0.113.42, key AKIAIOSFODNN7EXAMPLE.", "types": ["EMAIL", "CREDIT_CARD"], "minConfidence": 0.6}'
Return the text with personal data masked, labelled or hashed
Same detection pass as /v1/scan, then replaces each finding. mask keeps the last keepLast characters, label uses stable [TYPE_n] tokens per distinct value, hash uses [TYPE_xxxxxxxx] built from the first 8 hex characters of the value's SHA-256 and additionally returns a mapping of hash to occurrence count. Raw values are never echoed in the mapping.
Request body
{
"text": "Hi, I am Jane Doe. Reach me at jane.doe@example.com or 555-123-4567.",
"types": [
"EMAIL",
"PHONE"
],
"minConfidence": 0.5,
"style": "mask",
"keepLast": 4
}
curl example
curl -s -X POST 'https://piishield.ayamk.in/v1/redact' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: piishield.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{"text": "Hi, I am Jane Doe. Reach me at jane.doe@example.com or 555-123-4567.", "types": ["EMAIL", "PHONE"], "minConfidence": 0.5, "style": "mask", "keepLast": 4}'
Screen text for profanity, sexual and promotional terms
Matches a hand written lexicon in English, Spanish, French and German after undoing leetspeak (0 to o, 1 to i, @ to a), repeated letters and single-character punctuation separators such as f.u.c.k. Every match reports its severity (low/medium/high), category, a masked term and a masked context snippet. No slurs are shipped in the lexicon.
Request body
{
"text": "This sh1t is f.u.c.k.ing unbelievable!!!",
"langs": [
"en",
"es"
]
}
curl example
curl -s -X POST 'https://piishield.ayamk.in/v1/profanity' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: piishield.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{"text": "This sh1t is f.u.c.k.ing unbelievable!!!", "langs": ["en", "es"]}'
Score text from 0 to 100 with 11 spam heuristics
Additive heuristic scoring: exclamation density, ALL CAPS ratio, link count, shortener domains, money and prize phrases, urgency phrases, credential phishing, emoji density, repeated characters, phone plus link, and crypto scam phrasing. Returns the score, the band (clean, suspicious or spam) and every contributing signal with its maximum weight, awarded points and short evidence strings.
Request body
{
"text": "Contact Jane Doe at jane.doe@example.com or +1 (555) 123-4567."
}
curl example
curl -s -X POST 'https://piishield.ayamk.in/v1/spam' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: piishield.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{"text": "Contact Jane Doe at jane.doe@example.com or +1 (555) 123-4567."}'
Combined PII, profanity and spam moderation in one call
Flagship endpoint: one pass returns the full PII scan, the profanity result, the spam score and a combined verdict (allow, review or block) scored 45% PII risk, 35% spam and 20% profanity. Every reason names detector ids, counts and scores only - never raw values.
Request body
{
"text": "WIN a $1000 gift card NOW!!! Verify your account at https://bit.ly/xk9 and call 555-123-4567. Email jane.doe@example.com.",
"piiTypes": [
"EMAIL",
"PHONE"
],
"minConfidence": 0.5,
"profanityLangs": [
"en"
]
}
curl example
curl -s -X POST 'https://piishield.ayamk.in/v1/moderation' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: piishield.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{"text": "WIN a $1000 gift card NOW!!! Verify your account at https://bit.ly/xk9 and call 555-123-4567. Email jane.doe@example.com.", "piiTypes": ["EMAIL", "PHONE"], "minConfidence": 0.5, "profanityLangs": ["en"]}'
List every detector, redaction style and spam signal
Machine readable metadata for the whole API: detector id, label, description, example, validator, confidence range and risk weight; the three redaction styles; the four profanity languages; the 11 spam signals with weights; and the hard request and response caps. Use it to build a UI or to pick the types you pass to /v1/scan.
curl example
curl -s -X GET 'https://piishield.ayamk.in/v1/types' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: piishield.p.rapidapi.com'
Generated from piishield.ayamk.in/openapi.json on 2026-11-22. If the page and the spec ever disagree, the spec is right.