Remove Duplicate Lines API
Remove repeated lines from text, keeping the first occurrence of each and the original order.
POST /api/v1/tools/remove-duplicate-linesMCP remove_duplicate_linesText & WritingDelete repeated lines from any list or text while keeping the first occurrence and original order. Optional case-insensitive and whitespace-tolerant matching.
Input
Send these as a JSON object. Unknown fields are rejected.
- input
- The text, one item per line. (string, required)
- caseInsensitive
- Treat "Apple" and "apple" as the same line. (boolean, default false)
- trim
- Ignore leading and trailing whitespace when comparing lines. (boolean, default true)
- keepBlankLines
- Never remove blank lines, so paragraph spacing survives. (boolean, default false)
curl https://pithlab.com/api/v1/tools/remove-duplicate-lines \n -H "Authorization: Bearer $PITHLAB_KEY" \n -H "Content-Type: application/json" \n -d '{"input":"apple\nbanana\nApple\napple\ncherry","caseInsensitive":true}'Example response
{
"ok": true,
"result": {
"output": "apple\nbanana\ncherry",
"total": 5,
"kept": 3,
"removed": 2
}
}