{"uid":"cap_YOJK-9EWU_pqtsOKGDlYK","slug":"locale-aware-string-sorter-53e35b5b","name":"Locale-Aware String Sorter","description":"Sort up to 200 strings by locale rules (German a-umlaut, Swedish a-ring, Spanish n-tilde) with numeric option.","url":"https://locale-tools.x402tookit.com/sort-text?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["items"],"properties":{"items":{"type":"string","description":"Strings separated by | or newline, or a JSON array; at most 200 items of 100 characters"},"order":{"type":"string","description":"asc (default) or desc"},"locale":{"type":"string","description":"BCP47 tag such as sv, de, es (default en-US, up to 60 characters)"},"numeric":{"type":"boolean","description":"true to sort digit runs by value (file2 before file10); default false"},"caseFirst":{"type":"string","description":"upper, lower or false (locale default)"},"sensitivity":{"type":"string","description":"base, accent, case or variant (default variant)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"locale":{"type":["null","string"]},"sorted":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"numeric":{"type":["boolean","null"]},"reasons":{"type":["array","null"]},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"collation":{"type":["null","string"]},"itemCount":{"type":["null","number"]},"disclaimer":{"type":["null","string"]},"icuVersion":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"cldrVersion":{"type":["null","string"]},"resolvedLocale":{"type":["null","string"]},"unicodeVersion":{"type":["null","string"]},"originalIndexes":{"type":["array","null"],"items":{"type":"number"}}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","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.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_jg72ETie4ikB9FLj8-d_G","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Sorts up to 200 strings using locale-specific collation rules (German umlauts, Swedish rings, Spanish tildes) with optional numeric sorting.","exampleAgentPrompt":"Sort these 15 product names alphabetically using German locale rules so that umlauts like ä, ö, and ü are placed correctly: Äpfel, Banane, Zebra, Österreich, Ufer — return them in ascending order.","exampleUseCases":[{"title":"Alphabetizing Swedish contact list","prompt":"I have a list of Swedish customer names including some with å, ä, and ö characters — can you sort them correctly using Swedish locale rules so the ordering matches what a Swedish speaker would expect?"},{"title":"Natural sort for versioned filenames","prompt":"Sort these filenames in the right numeric order: file10.txt, file2.txt, file1.txt, file20.txt — use natural sort so file2 comes before file10, not after."},{"title":"Spanish dictionary word ordering","prompt":"I need to sort this Spanish vocabulary list alphabetically with the ñ character placed correctly according to Spanish locale rules: año, anon, cañon, canon, mano, maño."}],"resultDescription":"Returns a JSON object containing the sorted array of strings, the resolved locale used, collation settings, original indexes (for mapping back to source positions), item count, ICU/CLDR/Unicode version metadata, and a degraded flag indicating whether full locale support was available.","failureModes":["More than 200 items submitted — request rejected","Individual string exceeds 100 characters — may be truncated or rejected","Invalid or unrecognized BCP47 locale tag — falls back to en-US or returns error","Malformed items parameter (not pipe-separated, newline-separated, or valid JSON array)","Invalid enum value for order, caseFirst, or sensitivity parameters"],"whenToPreferThis":"Choose this endpoint when you need linguistically correct sorting that respects locale-specific collation rules (umlauts, rings, tildes, accented characters) rather than plain Unicode codepoint ordering. It is especially valuable for multilingual applications, displaying sorted lists to end users in their native language, or when natural numeric sorting of filenames or version strings is required. Prefer this over JavaScript's default sort or simple ASCII ordering whenever the strings contain non-ASCII characters or locale-sensitive ordering matters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-02T12:30:57.893Z","isFirstParty":false,"canonicalSlug":"locale-aware-string-sorter-53e35b5b"}