# Text Analyze API

> Analyze text: character / word / line / sentence / byte counts plus a SHA-256 digest. Pure-compute, no network — a native Rust marketplace endpoint.

Category: [Developer Tools APIs](https://upapi.io/apis/developer-tools) · Last updated 2026-11-02

## How to call it

- Endpoint: `POST https://api.upapi.io/text-analyze.post`, key in the `X-Api-Key` header, JSON body.
- Cost: 1 weighted unit per call.
- Timeout: 10 seconds.
- Cache: identical requests are served from cache for 3600 seconds, unbilled.
- Try it without writing code: https://app.upapi.io/try/text-analyze.post

```bash
curl -X POST https://api.upapi.io/text-analyze.post \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{ "text": "Hello, world" }'
```

## Request parameters

- `text` (string, required) — The text to analyze.

## Response fields

- `bytes` (integer, required)
- `lines` (integer, required)
- `words` (integer, required)
- `sha256` (string, required) — Lowercase hex SHA-256 of the UTF-8 bytes.
- `sentences` (integer, required)
- `characters` (integer, required)

## Example request and response

The example response is generated from the published output schema: it shows the shape and field names, not values from a recorded call.

```json
{
  "text": "Hello, world"
}
```

```json
{
  "bytes": 1,
  "lines": 1,
  "words": 1,
  "sha256": "example",
  "sentences": 1,
  "characters": 1
}
```

## Frequently asked questions

### How much does the Text Analyze API cost per call?

Each call spends 1 weighted unit of your plan's monthly quota. Full pricing is at https://upapi.io/pricing.

### How do I authenticate to the Text Analyze API?

Send your key in the X-Api-Key header. A free guest key is available without creating an account.

### Are Text Analyze API responses cached?

Yes — identical requests are served from cache for 3600 seconds, and a cache hit is not billed.

## More Developer Tools APIs

- [Check a GitHub Account's Health](https://upapi.io/apis/developer-tools/github-account-health)
- [Detect Website Tech Stack](https://upapi.io/apis/developer-tools/detect-tech-stack)
- [Follow or Unfollow a GitHub User](https://upapi.io/apis/developer-tools/github-user-follow)
- [Get GitHub Repository](https://upapi.io/apis/developer-tools/github-repo)
- [Get GitHub Trending Repositories](https://upapi.io/apis/developer-tools/github-trending)
- [Get GitHub User](https://upapi.io/apis/developer-tools/github-user)
- [Get GitHub User Commit Emails](https://upapi.io/apis/developer-tools/github-user-emails)
- [Get npm Package](https://upapi.io/apis/developer-tools/npm-package)
