SDK & Libraries

Get started in minutes with our official SDKs and code examples.

Python Official

pip install redactiphi
from redactiphi import RedactiPHI

# Initialize client
client = RedactiPHI(api_key="your-api-key")

# De-identify text
result = client.deidentify(
    "Patient John Smith, DOB 01/15/1980, SSN 123-45-6789",
    policy="safe_harbor"
)

print(result.text)
# Output: "Patient [NAM_abc123], DOB [DAT_def456], SSN [SSN_REDACTED]"

print(result.phi_found)  # 3

# Re-identify when needed
original = client.reidentify(result.text, result.document_id)
print(original.text)
# Output: "Patient John Smith, DOB 01/15/1980, SSN 123-45-6789"

JavaScript / Node.js

npm install @redact/phi
import { RedactiPHI } from '@redact/phi';

// Initialize client
const client = new RedactiPHI({ apiKey: 'your-api-key' });

// De-identify text
const result = await client.deidentify({
    text: 'Patient John Smith, DOB 01/15/1980',
    policy: 'safe_harbor'
});

console.log(result.text);
// Output: "Patient [NAM_abc123], DOB [DAT_def456]"

cURL / REST API

# De-identify text
curl -X POST https://api.redact.health/api/v1/deidentify \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Patient John Smith, DOB 01/15/1980",
    "policy": "safe_harbor"
  }'

# Response:
# {
#   "text": "Patient [NAM_abc123], DOB [DAT_def456]",
#   "document_id": "doc_xyz789",
#   "phi_found": 2,
#   "phi_types": {"NAME": 1, "DATE": 1}
# }
View Full API Docs Get Started