utilpeek: sort, dedupe and clean up lines of text
text_linesTransform lines of text by trimming, deduping, sorting, reversing, shuffling, or numbering them; optionally count unique lines.
Instructions
utilpeek: Sort, dedupe, trim, shuffle or number the lines of a text. For find and replace use text_replace. Returns the text's lines transformed by operations in order: trim, remove_empty, dedupe (keeps the first), sort (lexical, natural or length; stable), reverse, shuffle (seeded, repeatable) and number; optionally the most frequent lines with counts. At most 200,000 lines. Typically under 0.3 s. Price: USD 0.001. Free: 10 utilpeek calls per IP per UTC day. The submitted text is never logged or stored.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Shuffle seed: same seed, same order. | |
| text | Yes | The text (at most 200,000 characters). | |
| top_n | No | With count_unique: how many of the most frequent lines to return (1-1000, default 100). | |
| sort_mode | No | For sort: lexical (default, by character), natural (numbers by value: item 9 before item 10) or length (shortest first). | lexical |
| descending | No | For sort: largest first (default false: ascending). | |
| operations | Yes | Applied in order: trim, remove_empty, dedupe, sort, reverse, shuffle, number. | |
| count_unique | No | Also return the most frequent lines with counts. | |
| number_start | No | For number: the first line's number (-1,000,000 to 1,000,000; default 1). | |
| case_insensitive | No | dedupe / sort / count compare casefolded lines. | |
| number_separator | No | For number: text between the number and the line (at most 10 characters; default ". "). | . |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | ||
| seed | No | ||
| text | No | ||
| error | No | Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object. | |
| source | No | ||
| removed | No | ||
| lines_in | No | ||
| lines_out | No | ||
| operations | No | ||
| unique_lines | No |