Scraped Text Sanitizer
Pricing
from $2.00 / 1,000 record cleaneds
Scraped Text Sanitizer
Fix mojibake, decode HTML entities, strip HTML tags, NFKC-normalize, and collapse whitespace in text records you supply.
Pricing
from $2.00 / 1,000 record cleaneds
Rating
0.0
(0)
Developer
Simon Fletcher
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
4 days ago
Last modified
Categories
Share
Scraped Text Sanitizer repairs dirty, garbled text in records you already have — no scraping, no login, no API keys. Paste an array of records (or a single string) and it fixes mojibake, decodes HTML entities, strips leftover HTML tags, applies Unicode NFKC normalization, optionally removes emoji, and collapses whitespace — every step individually toggleable. You get back clean text plus a per-record summary of exactly what changed.
It runs on the Apify platform, so you get API access, scheduling, integrations (Make, Zapier, n8n), and pay-per-record billing with no infrastructure to manage.
What does Scraped Text Sanitizer do?
Text harvested from the web, PDFs, CSV exports, or old databases is frequently broken: Café instead of Café, Tom & Jerry instead of Tom & Jerry, stray <p>/<span> tags, fullwidth and ligature characters, and messy whitespace. This Actor cleans all of that in one pass. It only transforms data you supply — it never fetches, crawls, or logs into anything.
Under the hood it uses the battle-tested ftfy library for mojibake repair, Python's standard html and unicodedata for entity decoding and NFKC normalization, and deterministic rules for tag stripping and whitespace collapsing.
Why use Scraped Text Sanitizer?
- Fix mojibake at scale — repair
é,’, and other encoding damage without writing a script. - Clean up scraper output — decode entities and strip HTML tags that leak into extracted text.
- Normalize for search & dedup — NFKC folds fullwidth forms and ligatures so records match.
- Full transparency — every record reports which operations changed it, so you can trust the result.
- No code, no servers — run on demand, on a schedule, or from your own app via the Apify API.
How to use Scraped Text Sanitizer
- Open the Actor and go to the Input tab.
- Paste your records into the Records to clean field (an array of strings, or objects with a
textfield). Optionally add a single text string. - Toggle the cleaning operations you want (all on by default except Strip emoji).
- Click Start. When it finishes, open the Output tab or download the dataset as JSON, CSV, Excel, or HTML.
Input
| Field | Type | Description |
|---|---|---|
records | array | Records to clean. Each item is a string, or an object containing the text field named by textField. Add an id to join results back to your source. |
text | string | Optional single string to clean, processed in addition to records. |
textField | string | For object records, the property holding the text (default text). |
fixMojibake | boolean | Repair encoding damage / mojibake (default true). |
decodeHtmlEntities | boolean | & → &, < → < (default true). |
stripHtmlTags | boolean | Remove leftover HTML tags (default true). |
normalizeUnicode | boolean | Unicode NFKC normalization (default true). |
stripEmoji | boolean | Remove emoji and pictographs (default false). |
collapseWhitespace | boolean | Collapse whitespace runs to single spaces and trim (default true). |
Input example
{"records": [{ "id": "a", "text": "Café & Crêpes <b>Paris</b> " },{ "id": "b", "text": "Rock & Röll finale" }],"stripEmoji": false}
Output
Each input record produces one dataset item with the cleaned text and a change summary. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.
{"id": "a","recordIndex": 0,"cleanedText": "Café & Crêpes Paris","originalText": "Café & Crêpes <b>Paris</b> ","changed": true,"changes": {"fixedMojibake": true,"decodedHtmlEntities": true,"strippedHtmlTags": true,"normalizedUnicode": false,"collapsedWhitespace": true},"originalLength": 41,"cleanedLength": 19,"billed": true}
Output fields
| Field | Type | Description |
|---|---|---|
id | string/number | Pass-through identifier from the input record, if supplied. |
recordIndex | integer | Zero-based position of the record in the processed input. |
cleanedText | string | The sanitized text after all enabled operations. |
originalText | string | The exact input text before cleaning. |
changed | boolean | true if the cleaned text differs from the original. |
changes | object | Per-operation flags — true if that enabled operation modified the text. Only enabled operations appear. |
originalLength | integer | Character count of the original text. |
cleanedLength | integer | Character count of the cleaned text. |
billed | boolean | true if the record was charged as a paid result (non-empty output under pay-per-event). |
Pricing
This Actor uses pay-per-result billing: you are charged once per non-empty cleaned record. Empty or whitespace-only inputs are returned for transparency but are never charged. Compute is negligible (tens of thousands of records per second), so cost is dominated by the per-record price set in the Console. See PRICING.md for the unit-economics rationale.
Tips
- Leave Strip emoji off unless you specifically need emoji removed — they are often meaningful content.
- Disable operations you don't need (e.g. keep HTML tags) via the toggles; the change summary reflects only the operations you enabled.
- Use the
idfield on records to join cleaned output back to your source rows.
FAQ and support
- Does it scrape or fetch anything? No. It only transforms data you pass in as input. There is no network access, authentication, or PII harvesting.
- What fixes mojibake? The ftfy library's encoding repair, applied before entity decoding and normalization.
- Something looks wrong? Open the Issues tab with an example input and the expected output.