Text Diff API - Compare Two Texts, 0-100 Similarity Score avatar

Text Diff API - Compare Two Texts, 0-100 Similarity Score

Pricing

$20.00 / 1,000 diff runs

Go to Apify Store
Text Diff API - Compare Two Texts, 0-100 Similarity Score

Text Diff API - Compare Two Texts, 0-100 Similarity Score

Text diff and similarity API. Input: two text strings. Output: JSON with line- and word-level diffs, counted additions and deletions, and a 0-100 similarity score. Deterministic, no API key. Pay per result: $0.02 per diff run. Good for dedup and change tracking.

Pricing

$20.00 / 1,000 diff runs

Rating

0.0

(0)

Developer

Anthony Snider

Anthony Snider

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

10 days ago

Last modified

Share

Text Diff & Similarity

Compare two texts and get a clean diff plus similarity metrics in one call.

Live on the Apify Store — run it instantly or call it as an agent tool via Apify MCP.

What you get

  • Structured diff — an ordered list of operations [{ type: add | del | equal, value }] at line or word granularity (Myers/LCS).
  • Similarity score — a 0–100 percentage blending a character-level Levenshtein ratio with token-set Jaccard.
  • Change countsadded, removed, changed, and equal units.
  • Bulk mode — pass a pairs array to diff up to 50 text pairs in a single run.

Input

{
"textA": "The quick brown fox\njumps over the lazy dog.\nGoodbye.",
"textB": "The quick brown fox\nleaps over the lazy dog.\nHello there.\nGoodbye.",
"mode": "line"
}
FieldTypeRequiredDescription
textAstringyesOriginal / left text.
textBstringyesChanged / right text.
modestringnoline (default) or word diff granularity.

Bulk: send { "pairs": [{ "textA": "...", "textB": "...", "mode": "word" }, ...] }.

Output

{
"mode": "line",
"similarityPct": 74.62,
"added": 2,
"removed": 1,
"changed": 1,
"equal": 2,
"levenshteinRatioPct": 64.81,
"jaccardPct": 84.42,
"diff": [
{ "type": "equal", "value": "The quick brown fox" },
{ "type": "del", "value": "jumps over the lazy dog." },
{ "type": "add", "value": "leaps over the lazy dog." },
{ "type": "add", "value": "Hello there." },
{ "type": "equal", "value": "Goodbye." }
]
}

One dataset item is pushed per text pair.