Get started

The Safe-Text API provides programmatic access to clean short and long texts. It is probably world most complete text-cleaner API! Providing very fast and accurate results (based on machine learning and expert made algorithms)

To use this API, you need an API key via the RapidAPI platform and through our API on Safe-Text . Please contact us by email for any help.

Note that Safe-Text API is a gigantic wrapper on top of other bright solutions; We have glued many other bright libraries to work in one single API. It is a complex solution technically as many technologies (Python, Rust, Wasm, Node ...) are all working together in one single API call.

Note that Safe-Text updates its models regularly to improve accuracy.

Confirmed clients

Our cloud service is widely adopted, with a large number of users constantly trying our free plan. Among them, we are proud to serve professional users as well like architectes.ch.

Architectes.ch

Cleansing API

Use the Cleansing API to make cleansings operations for supported languages :
/api/meta To get current information about the API
/api/clean_text?text=hello%20world&models=Punctuate' To run the 'Punctuate' model

Supported languages: en

Note: All models are optional so you can choose all or some of them.
The order of execution is always the same though (at least in the current version). Play with swagger API 🔗


Cleansing query parameters

Field Type Description
text string The text to be cleand
models Subset of ["FixHTML", "Linkify", "FixMojibak", "Punctuate", "Decancer", "BadWords", "StripTags", "DetectLanguage"] Models to apply

Models

  • FixHTML
  • We use Tidy HTML for correcting invalid HyperText Markup Language, detecting potential web accessibility errors and for improving the layout and indent style of the resulting markup.

  • DOMPurify
  • DOMPurify sanitizes HTML and prevents XSS attacks.

  • Linkify
  • Linkify finds links in plain-text and converting them to HTML <a> tags.

  • FixMojibak
  • We use ftfy under the hood. ftfy fixes Unicode that’s broken in various ways. The goal of ftfy is to take in bad Unicode and output good Unicode, for use in your Unicode-aware code.

  • Punctuate
  • Punctuate is another intelligent ML model to fix punctuation in English texts.

  • Decancer
  • Decancer removes common unicode confusables/homoglyphs from strings.

  • BadWords
  • Remove bad (profanity) english words.

  • StripTags
  • Completely strip XML/HTML tags from text.

  • DetectLanguage
  • Detect the language of the text.

Anonymization API

Anonymizer automatically remove or obscure personally identifiable information (PII) and sensitive data from English text by masking or redacting:
/api/anonymize_text?text=her%20name%20is%20Betty%20and%20her%20credit%20card%20number%20is%20378282246310005&entities=CREDIT_CARD,PERSON To mask credit card number and name of a person in text


Anonymization query parameters

Field Type Description
text string The text to be anonymized
entities Subset of ["CREDIT_CARD", "CRYPTO", "DATE_TIME", "EMAIL_ADDRESS", "IBAN_CODE", "IP_ADDRESS", "NRP", "LOCATION", "PERSON", "PHONE_NUMBER", "MEDICAL_LICENSE"] Entities to mask or redact

Errors

Error code Meaning
404 Endpoint not found error: Wrong route
400 Validation error: Wrong parameters (see above)
502 Bad gateway: Server is completely out of service