---
title: Text Comparison
slug: compare-text
url: https://apyverse.com/apyhub/service/compare-text
provider: ApyHub
categories: [Developer Tools]
tags: [text-diff, code-diff, comparison, diffing, developer-tools]
auth: api_key
---

# Text Comparison

Compare two text or code snippets by char, word, or line. Useful for reviewing edits, diffs, and simple before/after checks.

## Endpoints

| Method | Path | Description | Atoms |
| --- | --- | --- | --- |
| POST | `` | What it does Compares two text or code snippets sent in the request body. The endpoint’s response s… | 10 |

## About

## What it does
Text Comparison lets you compare two text or code snippets and pass in a comparison mode of `char`, `word`, or `line`. Send `text1` and `text2`, and use the mode that matches the level of detail you need for your diff workflow.

Use it when you need to check changes between draft revisions, review code snippets, or spot line-level edits in generated content. Because the input is just two strings plus an optional mode, it fits well into editors, CI checks, review tools, and automation that needs a simple before/after comparison step.

The request schema is intentionally small: `text1` and `text2` are required, and `mode` is optional. The endpoint returns an empty response schema, so treat it as a comparison action rather than a structured data source. That makes Text Comparison useful as a lightweight utility for detecting differences without adding parsing overhead.

## Usage

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyverse.com/apyhub/service/compare-text
