{"uid":"cap_4zBpVKnwIPVZpcjn9IwKd","slug":"lordevo-text-diff-d503b119","name":"Lordevo Text Diff","description":"Text diff: unified diff, hunks and similarity of two texts: Compares two texts you send and returns whether they are identical, a similarity score, counts of added, removed and unchanged lines (or words or characters), plus a unified diff and hunks in line mode or a change list in word and char mode","url":"https://shop.lordevo.com/api/quick/text-diff?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":["before","after"],"properties":{"mode":{"enum":["line","word","char"],"type":"string","default":"line","description":"Compare by line (default, unified diff), word or character"},"after":{"type":"string","maxLength":200000,"description":"The new text, up to 200,000 characters (POST for long text)"},"before":{"type":"string","description":"The original text, up to 200,000 characters (POST JSON {\"before\": \"...\", \"after\": \"...\"} for long text)"},"context":{"type":"string","default":"3","pattern":"^\\d{1,2}$","description":"Unchanged lines around each change in line mode, 0-20 (default 3)"},"ignore_case":{"enum":["yes","no"],"type":"string","default":"no","description":"Ignore upper/lower case"},"ignore_whitespace":{"enum":["yes","no"],"type":"string","default":"no","description":"Line mode: ignore leading/trailing whitespace"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["tool","identical","similarity","stats"],"properties":{"mode":{"enum":["line","word","char"],"type":"string"},"tool":{"type":"string"},"unit":{"type":"string"},"hunks":{"type":"array","items":{"type":"object","properties":{"lines":{"type":"array","items":{"type":"string"}},"new_lines":{"type":"integer"},"new_start":{"type":"integer"},"old_lines":{"type":"integer"},"old_start":{"type":"integer"}}}},"stats":{"type":"object","properties":{"added":{"type":"integer"},"removed":{"type":"integer"},"unchanged":{"type":"integer"}}},"changes":{"type":"array","items":{"type":"object","properties":{"type":{"enum":["added","removed","unchanged"],"type":"string"},"value":{"type":"string"}}}},"unified":{"type":"string"},"identical":{"type":"boolean"},"similarity":{"type":"number","maximum":1,"minimum":0}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm__vE5JasnL_644hgx9tevj","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compares two texts and returns identical flag, similarity score, line/word/char stats, unified diff, and hunks","exampleAgentPrompt":"Compare these two paragraphs word by word and tell me the similarity score, what was added, what was removed, and show me the full diff: before: 'The quick brown fox jumps over the lazy dog.' after: 'The quick red fox leaped over the sleeping cat.'","exampleUseCases":[{"title":"Code review change detection","prompt":"I have two versions of a config file and I need to see exactly which lines changed — can you diff them in line mode with 5 lines of context and tell me the similarity score? Before: 'server: localhost\nport: 8080\ndebug: true' After: 'server: production.example.com\nport: 443\ndebug: false'"},{"title":"Document revision comparison","prompt":"Can you compare these two paragraphs character by character and list every character that was added or removed? Before text: 'colour' After text: 'color'"},{"title":"Duplicate content check","prompt":"Are these two article intros basically the same? Give me a similarity score and show any differences — ignore case differences. Before: 'Welcome to our store, where quality meets affordability.' After: 'Welcome to Our Store, Where Quality Meets Affordability!'"}],"resultDescription":"Returns a JSON object with: an 'identical' boolean, a 'similarity' float (0–1), a 'stats' object with added/removed/unchanged counts, and either a 'unified' diff string plus 'hunks' array (line mode) or a 'changes' array of typed segments (word/char mode). Also includes the 'mode' and 'tool' metadata fields.","failureModes":["Missing 'before' or 'after' query parameters returns a validation error","Text exceeding 200,000 characters via GET may be rejected — use POST for long inputs","Invalid 'mode' enum value returns an error","Invalid 'context' value (non-numeric or out of 0–20 range) returns a validation error","Network timeout if texts are very large"],"whenToPreferThis":"Choose this endpoint when you need a structured, machine-readable diff with similarity scoring and per-unit statistics (line, word, or char) rather than just a raw diff string. It is ideal for agents that need to programmatically process change hunks, detect near-duplicates, or report what fraction of content changed. Use it over generic string comparison when you need unified diff format with context control.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T18:40:34.729Z","isFirstParty":false,"canonicalSlug":"lordevo-text-diff-d503b119"}