# Text-check API with a key and plain JSON.

> How to call the AI-signal text check from your own programs: key, endpoints, curl, Python and Node.js examples, errors and limits.

- URL: https://authortext.com/en/developers
- Language: en
- Site: AuthorText (https://authortext.com/)

The same analysis as on the site, for your own programs: score, metrics, spots in the text with quotes, cleaning and marking. Requests and responses are JSON.

## Endpoints

These requests accept the key; account and payment requests do not.

| Method | Path | Body | Purpose |
| --- | --- | --- | --- |
| POST | `/api/analyze` | `{"text": "..."}` | Score, metrics, spots in the text with quotes, watermarks |
| POST | `/api/clean` | `{"text": "..."}` | Cleaning: removes hidden characters and typography; a text that is too long is cut to the plan limit (truncated, limit) |
| POST | `/api/highlight` | `{"text": "..."}` | Marks the found spots for highlighting |
| POST | `/api/fetch-url` | `{"url": "..."}` | Loads a page by address and analyzes its text |
| POST | `/api/extract-file` | `file` | Text from a file: PDF, DOCX, ODT, RTF, EPUB, FB2, HTML, TXT |
| GET | `/api/me` |  | The key's plan and its limits |

## Good to know

- **Nothing stored.** The text is processed in memory, never written to disk and never logged.
- **Key and plan.** The key is created in your account and shown once; the server keeps only its fingerprint. A new key replaces the old one.
- **One error format.** An error always looks like {"error": {"code", "message"}}, with no stack traces.
- **Text, link, file.** Send a text, a page address or a whole document.

## API by key: the Pro and Max plans

Prices and limits are read from the server, so they cannot drift from the real ones. Live data: https://authortext.com/api/plans.

- The API key is included in the Pro and Max plans.
- All kinds of analysis and fragment review
- Authorization: Bearer header for analysis, cleaning, marking, loading by link and from a file
- The key works while the paid period is running

## Errors and limits

| HTTP status | code | When |
| --- | --- | --- |
| 400 | `invalid_json` | The request body is not valid JSON |
| 413 | `payload_too_large` | The request body is too large |
| 415 | `unsupported_media_type` | Content-Type is not application/json |
| 422 | `empty_text / invalid_text` | The text field is empty, missing or not a string |
| 422 | `text_too_long` | The text is longer than the plan allows; the reply carries limit and plan |
| 429 | `rate_limited` | Too many requests; see the Retry-After header |

- Requests are counted as a "burst": first you can send as many in a row as shown above, then that many per second. Loading by link or from a file costs 5 requests; a text over 100,000 characters costs 1 more for every 100,000.
- A missing, wrong or expired key does not produce an error: the request is handled as a free one, with the free limits (3,000 characters). Check the plan with GET /api/me.
- The score is a guide, not proof of authorship.

## The key is created in your account

Subscribe to the Pro or Max plan, open the "API key" section in your account and press "Create key".

## Links

- [Home](https://authortext.com/en/index.md)
- [plans](https://authortext.com/en/plans.md)
- [help](https://authortext.com/en/help.md)
- [developers](https://authortext.com/en/developers.md)
- [about](https://authortext.com/en/about.md)
- [method](https://authortext.com/en/method.md)
- [faq](https://authortext.com/en/faq.md)
- [privacy](https://authortext.com/en/privacy.md)
- [terms](https://authortext.com/en/terms.md)
- [articles](https://authortext.com/en/articles/index.md)
