Grammar Checker Template
- Next.js
- TypeScript
Proofread any text and review each suggested fix in place: take it, keep your wording, then copy the result.
A Next.js app that proofreads text. Paste an email, post or essay and every suggested fix appears in place with the original crossed out, plus a list where you take or reject each one. The finished text is rebuilt from your choices, ready to copy. Use it as a writing tool, or lift the API route and the diff to add proofreading to your own editor or CMS.

What it does
- Fixes shown in place
- Each change is drawn inside your text, with what you wrote crossed out and the fix beside it.
- You decide
- Take a fix or keep your own wording, one change at a time. Click a change in the text to flip it.
- Alternatives on paid plans
- When the API returns its corrections list, each change shows the reason and other wordings to choose from.
- Draft saved
- Your text is kept on the device while you write, so a refresh doesn’t lose it.
- Keeps your key private
- The browser only talks to your own API route, which caps the text at 5,000 characters, caches answers and limits each visitor to 10 checks a minute.
How it works
The API route: it checks the text, answers from the cache when it can, and calls Grammar Check.
/** POST /api/check { text }: proofreads a passage and returns the corrected text. */
export async function POST(request: Request) {
const body = await request.json().catch(() => null);
const text = String(body?.text ?? '').slice(0, MAX_CHARS);
if (!text.trim()) return fail('Write or paste some text to check');
const key = `check:${text}`;
const hit = fromCache<CheckResult>(key, TTL_MS);
if (hit) return Response.json(hit);
const blocked = guard(request);
if (blocked) return blocked;
return respond(async () => {
const data = await callApi<CheckResult>('grammarcheck', { json: { text } });
toCache(key, data);
return data;
});
}Deploy it
- Get a free API key
The free plan includes 200 credits a month, no card needed. Create your key.
- Deploy it
Click Deploy to Vercel. Vercel copies the repo to your GitHub account and asks for
APIVERVE_API_KEY: paste your key there. - Open your app
Vercel builds it and gives you a live URL, usually in about a minute. Every push to the repo redeploys it.
Try the Grammar Check API — the call this template makes
No key required to try it. Get a key to use it in your app.
{
"status": "ok",
"error": null,
"data": {
"modified": true,
"corrected": "The pig snorted when I saw it on the barn gate. I was a little mad because it woke up my puppy",
"errorCount": 3,
"dialect": "American",
"corrections": [
{
"rule": "Repetition",
"message": "Did you mean to repeat this word?",
"position": {
"start": 0,
"end": 7
},
"suggestions": [
"The"
]
},
{
"rule": "Spelling",
"message": "Did you mean `because`?",
"position": {
"start": 71,
"end": 78
},
"suggestions": [
"because"
]
},
{
"rule": "Spelling",
"message": "Did you mean `puppy`?",
"position": {
"start": 93,
"end": 101
},
"suggestions": [
"puppy",
"puppetry"
]
}
]
}
}