{"uid":"cap_XQY-ZQv8bWBNrb4jbkb36","slug":"preplayer-ai-text-diff-lcs-2a4fe3a9","name":"PrepLayer.ai Text Diff (LCS)","description":"Line-level LCS diff of two text blobs. Returns a structured edit script with insertions, deletions, unchanged line counts and per-operation metadata; with format='unified' also returns a unified-diff string.","url":"https://api.maximusmediahouse.com/v1/diff?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"a":{"type":"string","description":"Original text."},"b":{"type":"string","description":"Modified text."},"format":{"enum":["unified"],"type":"string","description":"If 'unified', return a unified-diff string in `diff`."},"context":{"type":"integer","default":3,"maximum":100,"minimum":0,"description":"Lines of unchanged context around each hunk (unified only)."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ShIqIf_eYBfF9tcdS7YQE","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes a line-level LCS diff between two text blobs, returning a structured edit script with insertions, deletions, and unchanged line counts, optionally including a unified-diff string.","exampleAgentPrompt":"Can you diff these two versions of my README and show me the result as a unified diff with 5 lines of context around each change? Here's the original text and the modified text...","exampleUseCases":[{"title":"Code review change summary","prompt":"I have two versions of a Python script — the original and the one my colleague edited. Can you run a line-level diff and give me a unified diff string with 4 lines of context so I can see exactly what changed?"},{"title":"Document revision audit","prompt":"Here's the original draft of our legal agreement and the updated version. Can you compare them line by line and return an edit script showing which lines were inserted, deleted, or unchanged?"},{"title":"Detecting content tampering","prompt":"I need to verify whether this article was modified from the version we published last week. Can you diff the two text blobs and tell me the exact insertions and deletions?"}],"resultDescription":"A structured edit script listing each operation (insertion, deletion, unchanged block) with line counts and per-operation metadata. When format='unified' is requested, also returns a unified-diff string with the specified number of context lines around each hunk.","failureModes":["Missing required field 'a' or 'b' returns a 400 validation error","'context' value exceeding 100 returns a 422 out-of-range error","Extremely large text blobs may time out or return a payload-too-large error","Invalid 'format' enum value returns a 400 error","Payment failure or insufficient balance returns a 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need a deterministic, structured line-level diff (LCS-based) rather than semantic or fuzzy text comparison. It is especially useful when you need machine-readable edit scripts for downstream processing, or when you want a standard unified-diff patch string for display or storage. Prefer it over regex-based or character-level diff tools when line granularity and structured metadata (insertion/deletion counts) are required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T12:37:14.141Z","isFirstParty":false,"canonicalSlug":"preplayer-ai-text-diff-lcs-2a4fe3a9"}