---
title: "Text Similarity Analyzer"
method: POST
path: "/api/v1/tools/text-similarity-analyzer"
tags: ["tools"]
---

# Text Similarity Analyzer

`POST /api/v1/tools/text-similarity-analyzer`

## Request

- Base URL: `https://toolforte.com`
- URL: `https://toolforte.com/api/v1/tools/text-similarity-analyzer`
- Auth: HTTP bearer

Compare two texts with five named measures instead of one unexplained percentage: Jaccard over the word sets, cosine over the word counts, word overlap, Levenshtein edit distance with a ratio, and the longest common subsequence of words. It also returns the words the two share and the words only one of them has, plus word, character and sentence counts for each.

## Request body

- object
  - `textA` string
  - `textB` string
  - `commonWordLimit` integer
  - `uniqueWordLimit` integer

## Response `200`

Successful result

- object
  - `ok` boolean
  - `data` object
    - `overall` number
    - `jaccard` number
    - `cosine` number
    - `wordOverlap` number
    - `levenshteinDistance` integer
    - `levenshteinRatio` number
    - `levenshteinTruncated` boolean
    - `longestCommonSubsequence` integer
    - `a` object
      - `words` integer
      - `characters` integer
      - `sentences` integer
    - `b` object
      - `words` integer
      - `characters` integer
      - `sentences` integer
    - `commonWords` string[]
    - `onlyInA` string[]
    - `onlyInB` string[]

## Other responses

- `400`: Missing or invalid request fields
- `401`: Invalid or missing API key
- `429`: Monthly plan limit reached

---

[API](https://skmtc.dev/toolforte/apis/toolforte-api.md) · [All operations](https://skmtc.dev/toolforte/apis/toolforte-api/llms.txt) · [OpenAPI document](https://skmtc.dev/toolforte/apis/toolforte-api/revisions/4d814d484dfc?raw)
