# Playtest API

> A small, fast text-analysis API. Send text, get back word, sentence and character counts, reading time and the most used words, from one REST call.

Base URL: https://api-playtest.plxi.us. Authenticate with an `X-API-Key` header (create a key at https://playtest.plxi.us/dashboard/keys).
Every operation is a POST with a JSON body and returns JSON. Failed calls are never charged.
MCP server at https://api-playtest.plxi.us/mcp (same key, same price), with these operations as tools: analyze_text, slugify_text.

## Docs

- [API reference](https://playtest.plxi.us/docs): authentication, operations, limits, errors and webhooks
- [OpenAPI description](https://playtest.plxi.us/openapi.json): machine-readable spec of every operation
- [Pricing](https://playtest.plxi.us/pricing): Free $0/mo for 100 requests; Starter $10/mo for 2,000 requests; Pro $50/mo for 20,000 requests

## Operations

### POST https://api-playtest.plxi.us/v1/example/analyze

Word, sentence and character counts, reading time and the most used words. Costs 1 credit.

Request:

```json
{
  "text": "The quick brown fox jumps over the lazy dog. The dog sleeps.",
  "top": 3
}
```

Response:

```json
{
  "characters": 60,
  "characters_no_spaces": 49,
  "words": 12,
  "sentences": 2,
  "paragraphs": 1,
  "reading_time_seconds": 4,
  "top_words": [
    {
      "word": "dog",
      "count": 2
    },
    {
      "word": "brown",
      "count": 1
    },
    {
      "word": "fox",
      "count": 1
    }
  ],
  "credits": 1
}
```

### POST https://api-playtest.plxi.us/v1/example/slugify

Turn text into a URL-safe slug (accents removed, lowercase). Costs 1 credit.

Request:

```json
{
  "text": "Héllo Wörld: a new post!",
  "separator": "-",
  "max_length": 80
}
```

Response:

```json
{
  "slug": "hello-world-a-new-post",
  "credits": 1
}
```

## Guides

- [Add word count and reading time to any page with one API call](https://playtest.plxi.us/guides/word-count-and-reading-time): Send a post's text to Playtest API and get back its word count, reading time and most used words, ready to show next to the title.

## Comparisons

- [Playtest API vs textstat — a hosted alternative for text statistics](https://playtest.plxi.us/compare/textstat-alternative): textstat is a Python library for text statistics and readability scores. When a hosted API like Playtest API fits better, and when it doesn't.

## FAQ

- **How is reading time worked out?** Words divided by 230 words a minute, rounded up to the next whole second.
- **Does it handle accented text?** Yes. Accented letters count as letters, and slugify turns them into plain ASCII: Héllo Wörld becomes hello-world.
- **Is a failed request charged?** No. Only successful calls use credits; a 400 for bad input is free.

## Optional

- [Terms](https://playtest.plxi.us/terms)
- [Privacy](https://playtest.plxi.us/privacy)
- [Support](https://playtest.plxi.us/contact)
