{"uid":"cap_BpCIAxhKRXjEesQ_nhyQi","slug":"pennyrail-text-normalize-whitespace-2ee9de90","name":"PennyRail Text Normalize Whitespace","description":"Machine-readable settlement service","url":"https://pennyrail.vercel.app/api/f/text.normalize-whitespace","method":"POST","headers":{},"bodySchema":{"type":"object","required":["input"],"properties":{"input":{"type":"string","description":"string"}}},"responseSchema":{"type":"object","required":["operation","result"],"properties":{"result":{},"operation":{"type":"string"}},"additionalProperties":true},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_2H5fzpqB9_nzl_ErquJjf","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Normalizes whitespace in a string by collapsing multiple spaces, tabs, and newlines into single spaces and trimming leading/trailing whitespace","exampleAgentPrompt":"Can you normalize the whitespace in this string — collapse all the extra spaces, tabs, and newlines into single spaces and trim the edges: '  Hello   world\\n\\nthis   is   a   test  '?","exampleUseCases":[{"title":"Clean user-submitted form input","prompt":"I've got a user-submitted text field that has all sorts of extra spaces and newlines in it — can you normalize the whitespace so it's clean before I store it? Here's the raw value: '  John    Doe\\n\\n  123   Main   St  '"},{"title":"Preprocess text before NLP pipeline","prompt":"Before I run sentiment analysis on this customer review, I need to clean up the whitespace — can you normalize it for me? The text is: '  Great   product!\\t\\tWould    recommend   to   everyone.  '"},{"title":"Normalize code-extracted text","prompt":"I scraped some text from a PDF and it came out with really messy spacing — lots of double spaces and stray tabs. Can you normalize the whitespace in this string: 'Annual   Report\\t\\t2023\\n\\n  Total  Revenue:   $4.2M  '?"}],"resultDescription":"Returns a JSON object with an 'operation' field identifying the transformation applied and a 'result' field containing the whitespace-normalized string with all consecutive whitespace characters collapsed into single spaces and leading/trailing whitespace removed.","failureModes":["Missing required 'input' field returns a validation error","Non-string input types may cause a type error or unexpected behavior","Payment failure (402) if USDC balance is insufficient","Very long strings may hit payload size limits","Empty string input may return an empty result or error"],"whenToPreferThis":"Use this endpoint when you need a lightweight, pay-per-call whitespace normalization step in a text preprocessing pipeline and want to avoid rolling your own regex logic. Ideal for cleaning user-submitted text, scraped content, or OCR output before downstream processing. It is particularly useful in agentic workflows where you need a reliable, idempotent normalization primitive without spinning up a heavier NLP service.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:43:11.058Z","isFirstParty":false}