# Text Statistics (`text.stats`)

Count words, characters, sentences and paragraphs of a text, estimate reading time and readability, and list its most frequent words.

- **Route:** `POST /v1/run/text.stats`
- **Price:** $0.0002 per request ($0.20 per 1,000) · `cost_usd` on every response
- **Source:** GetAllAPIs compute (`compute`) · failover: no
- **Measured latency:** p50 6 ms · p95 6 ms · p99 6 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `text` | string | yes |  | Text to measure |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `words` | Word count. |
| `characters` | Character count. |
| `sentences` | Sentence count. |
| `paragraphs` | Paragraph count. |
| `reading_time_seconds` | Silent reading time at 238 words per minute. |
| `flesch_reading_ease` | Flesch reading ease (English heuristic). |
| `flesch_kincaid_grade` | Flesch-Kincaid US grade level. |
| `top_words` | Ten most frequent words, common English stop words removed. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/text.stats \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"GetAllAPIs gives your agent one key for many data APIs. You pay per request from a prepaid wallet. Failed calls are refunded."}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('text.stats', {'text': 'GetAllAPIs gives your agent one key for many data APIs. You pay per request from a prepaid wallet. Failed calls are refunded.'})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run text.stats '{"text":"GetAllAPIs gives your agent one key for many data APIs. You pay per request from a prepaid wallet. Failed calls are refunded."}'
```

Quote first (free, validates input): `POST /v1/quote/text.stats` with the same body.
