{"uid":"cap_WGs1vO6AW34ne5z40feuE","slug":"machine-shop-clean-text-712d5d1e","name":"Machine Shop – Clean Text","description":"Turn Apify product scrape results into safe catalog updates with Catalog Update Gate. Find evidence in supplied documents, compare snapshots, extract typed JSON fields, inspect x402 quotes and assess API migrations. Preview inputs, evidence and cost for free. No live web search, scheduled monitoring or third-party purchasing.","url":"https://api.pay-forge.online/v1/clean-text?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string","title":"Text","maxLength":50000,"description":"Text to process, including empty text; at most 50000 Unicode characters (413 if exceeded)."}}},"responseSchema":{"type":"json","example":{"text":"Hello world\nNext line.","chars_after":22,"chars_before":32}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_V8K3S-feLS1Nc3cqPkquc","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Strips and normalizes whitespace/formatting from raw text, returning the cleaned version along with before/after character counts.","exampleAgentPrompt":"Can you clean up this text for me — it has a bunch of extra spaces, weird line breaks, and trailing whitespace — and tell me how many characters were removed? Here's the text: 'Hello   world  \n\n  Next   line.  '","exampleUseCases":[{"title":"Normalize scraped web content","prompt":"I scraped some text from a webpage and it's full of extra whitespace and weird formatting. Can you clean it up and tell me how many characters got stripped out?"},{"title":"Preprocess document before field extraction","prompt":"Before I extract structured fields from this contract text, can you clean it up first — remove all the extra spaces and line breaks so the text is normalized?"},{"title":"Sanitize user-submitted form input","prompt":"A user just submitted this comment through our form and it has a ton of redundant whitespace. Can you clean it and let me know the character count before and after?"}],"resultDescription":"Returns a JSON object with the cleaned text string, the character count before cleaning (chars_before), and the character count after cleaning (chars_after), allowing callers to assess how much whitespace/formatting was removed.","failureModes":["Input text exceeds 50000 Unicode characters — returns HTTP 413","Malformed JSON body or missing 'text' field — likely 400 error","Empty text input is valid and returns chars_before and chars_after both as 0 or equal","Payment not provided or invalid x402 payment header — returns HTTP 402"],"whenToPreferThis":"Choose this endpoint when you need a lightweight, cost-effective text normalization step before downstream processing such as field extraction, comparison, or analysis. It is ideal as a preprocessing stage in a pipeline where consistent whitespace and formatting matters. Prefer it over building custom regex cleaning logic when working within the Machine Shop ecosystem, especially when you want a character-count audit of what was removed.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-20T12:36:05.917Z","isFirstParty":false,"canonicalSlug":"machine-shop-clean-text-712d5d1e"}