{"uid":"cap_lEcST6ZwKdlv6ibT_-ngZ","slug":"keyronne-com-text-diff-api-dbad3dd4","name":"keyronne.com Text Diff API","description":"Compare two texts with a Myers diff over lines, words, or characters. Returns structured edit operations, a standard unified diff (line mode), and similarity statistics. Built for agents tracking document revisions, verifying edits, or reviewing generated changes. POST a JSON body like: {\"a\":\"line one\\nline two\\n\",\"b\":\"line one\\nline 2\\n\",\"mode\":\"lines\"}","url":"https://keyronne.com/api/diff-text","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"a":{"type":"string","description":"Original text (up to 300k characters)."},"b":{"type":"string","description":"Modified text (up to 300k characters)."},"mode":{"enum":["lines","words","chars"],"type":"string","default":"lines"},"context":{"type":"integer","default":3,"maximum":20,"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_7OgXYCIBiisuF2eEh8FNf","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 using Myers diff algorithm over lines, words, or characters, returning structured edit operations, unified diff output, and similarity statistics.","exampleAgentPrompt":"Compare these two versions of my report word by word and show me what changed — here's the original: 'The project launched on Monday.' and the revised version: 'The project launched on Tuesday.' Use word mode.","exampleUseCases":[{"title":"Review AI-generated content edits","prompt":"I asked an AI to rewrite my product description, and I want to see exactly what it changed. Can you compare my original description with what the AI generated and show me all the differences at the word level?"},{"title":"Track document revision history","prompt":"We just updated our policy document and I need to verify what sections were modified. Compare the old version against the new one line by line and give me the structured changes so I can audit all the edits."},{"title":"Verify contract changes before signing","prompt":"My legal team sent me a revised contract. Before I sign, can you compare it character by character against the version I approved last week and tell me if there are any unexpected changes? I also want a similarity score to see how much actually changed."}],"resultDescription":"Returns structured edit operations describing insertions, deletions, and unchanged spans; a standard unified diff string in line mode; and similarity statistics including a similarity score between the two texts.","failureModes":["Input text exceeds 300k character limit — request rejected","Invalid mode value outside lines/words/chars enum — validation error","Missing 'a' or 'b' fields in request body — bad request error","Context value outside 0-20 range — validation error","Payment not included or insufficient — x402 payment required response"],"whenToPreferThis":"Use this endpoint when you need to programmatically compare two text documents and receive machine-readable edit operations (not just a human-readable diff), when you need similarity statistics alongside the diff, or when you need flexible granularity (line, word, or character level). Prefer this over generic string comparison when you need structured Myers diff output suitable for agent pipelines tracking document revisions or verifying AI-generated edits.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T13:07:06.575Z","isFirstParty":false}