API reference
Grammar checking
Member beta
POST https://paperpurr.com/v1/check
Checks English text for grammar, spelling, punctuation and concision, and can apply high-confidence corrections. Quotations, citations, links, code and reference lists are never changed.
Body parameters
textstring · required- English text, up to 10,000 words
auto_applyboolean · default true- When
false, only lists suggestions and returnstextunchanged levelstring · default allall: grammar, spelling, concision and contractions.correctness: grammar and spelling only.dialectstring · default ususoruk
Examples
curl
curl -X POST "https://paperpurr.com/v1/check" \
-H "Authorization: Bearer $PAPERPURR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"The results shows that the workshop helped. In order to test this, we has run a second survey.","auto_apply":true}'Python
import os
import requests
r = requests.post(
"https://paperpurr.com/v1/check",
headers={"Authorization": f"Bearer {os.environ['PAPERPURR_API_KEY']}"},
json={
"text": "The results shows that the workshop helped. In order to test this, we has run a second survey.",
"auto_apply": true
},
)
print(r.json())JS
const r = await fetch("https://paperpurr.com/v1/check", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PAPERPURR_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"text": "The results shows that the workshop helped. In order to test this, we has run a second survey.",
"auto_apply": true
}),
});
console.log(await r.json());Response
{
"text": "The results show that the workshop helped. To test this, we have run a second survey.",
"corrections": [
{
"before": "has",
"after": "have",
"category": "correctness",
"rule": "Agreement",
"message": "The form of the verb must agree in grammatical number with the pronoun.",
"sentence": "In order to test this, we has run a second survey."
},
{
"before": "In order to",
"after": "To",
"category": "clarity",
"rule": "wordy-phrase",
"message": "This phrase can be said in fewer words.",
"sentence": "In order to test this, we have run a second survey."
},
{
"before": "shows",
"after": "show",
"category": "correctness",
"rule": "subject-verb",
"message": "The subject and the verb don’t agree in number.",
"sentence": "The results shows that the workshop helped."
}
],
"suggestions": [],
"suggestions_total": 0,
"words": 18,
"request_id": "req_3b7e05c2f8a14d96b0e3c5a7"
}textstring · required- The corrected text
correctionsobject[] · required- Corrections that were applied. Fields as in Natural rewriting
suggestionsobject[] · required- Suggestions not applied, up to 40
textstring · required- The text at issue
replacementsstring[] · required- What to replace it with. An empty string means delete it
sentencestring- The sentence it’s in
categorystring · required- Category, such as
correctnessorclarity rulestring · required- Rule name
messagestring · required- The reason, in English
suggestions_totalinteger · required- Total suggestions, which can be more than were returned
wordsinteger · required- Words you sent
request_idstring · required- Request ID
Possible errors
| Status | code | Cause | What to do |
|---|---|---|---|
400 | missing_parameter | A required parameter is missing. param names it. | Add the parameter. |
400 | invalid_parameter | A parameter has the wrong type or value. param names it. | Fix it to match the type and range in the reference. |
400 | unknown_parameter | The request has a query parameter or body field the endpoint doesn’t accept. | Remove it or check the spelling. |
400 | invalid_json | The request body isn’t a JSON object. | Send a single JSON object with Content-Type: application/json. |
413 | too_long | text is over the per-call word limit. | Split it by section and call several times. |
413 | body_too_large | The body is too large: 128 KB at most for REST, 256 KB for MCP. | Send fewer or shorter items. |
429 | rate_limit_exceeded | A rate limit was hit. message explains. | Wait Retry-After seconds, then retry. Queue requests if several processes share one key. |
429 503 | busy | 429: the rewriting or check queue is full. 503: quota or usage can’t be read or recorded for the moment; nothing was processed or counted. | Wait for Retry-After if present; otherwise back off and retry. |
502 | upstream_unavailable | The literature databases, the rewriting model or the check service didn’t respond. | Retry later. Nothing is counted for this call. |
See Authentication for auth errors and Errors for the full list.
Metering
- Free during the beta, but counts toward your rate limit.
- Text you check isn’t stored.