SharpAPI.com Node.js SDK for proofreading text
npm install @sharpapi/sharpapi-node-proofread

SharpAPI Proofread & Grammar Checker uses advanced AI to detect and correct grammar, spelling, punctuation, and style errors. Perfect for content creation, document editing, and quality assurance.
---
1. Requirements
2. Installation
3. Usage
4. API Documentation
5. Examples
6. License
---
- Node.js >= 16.x
- npm or yarn
---
``bash`
npm install @sharpapi/sharpapi-node-proofread
Visit SharpAPI.com to get your API key.
---
`javascript
const { SharpApiProofreadService } = require('@sharpapi/sharpapi-node-proofread');
const apiKey = process.env.SHARP_API_KEY; // Store your API key in environment variables
const service = new SharpApiProofreadService(apiKey);
const text =
This is a sentance with some erors that need to be fixed.
Their are several gramatical mistakes in this text.;
async function proofreadText() {
try {
// Submit proofreading job
const statusUrl = await service.proofread(text);
console.log('Job submitted. Status URL:', statusUrl);
// Fetch results (polls automatically until complete)
const result = await service.fetchResults(statusUrl);
const corrections = result.getResultJson();
console.log('Original:', text);
console.log('Corrected:', corrections.corrected_text);
console.log('Errors found:', corrections.errors.length);
} catch (error) {
console.error('Error:', error.message);
}
}
proofreadText();
`
---
#### proofread(text: string, language?: string): Promise
Proofreads text and returns corrections for grammar, spelling, and punctuation errors.
Parameters:
- text (string, required): The text content to proofreadlanguage
- (string, optional): The language of the text (default: 'English')
Returns:
- Promise
Example:
`javascript`
const statusUrl = await service.proofread(textWithErrors, 'English');
const result = await service.fetchResults(statusUrl);
The API returns corrected text with detailed error information:
`json`
{
"corrected_text": "This is a sentence with some errors that need to be fixed. There are several grammatical mistakes in this text.",
"errors": [
{
"error": "sentance",
"correction": "sentence",
"type": "spelling",
"position": 10,
"explanation": "Incorrect spelling"
},
{
"error": "erors",
"correction": "errors",
"type": "spelling",
"position": 30,
"explanation": "Incorrect spelling"
},
{
"error": "Their",
"correction": "There",
"type": "grammar",
"position": 60,
"explanation": "Wrong usage of 'their' vs 'there'"
}
],
"error_count": 3
}
---
`javascript
const { SharpApiProofreadService } = require('@sharpapi/sharpapi-node-proofread');
const service = new SharpApiProofreadService(process.env.SHARP_API_KEY);
const draft =
I has been working on this project for three weeks.
Its going very good and we should be done soon.;
service.proofread(draft)
.then(statusUrl => service.fetchResults(statusUrl))
.then(result => {
const corrections = result.getResultJson();
console.log('āļø Corrected text:');
console.log(corrections.corrected_text);
console.log(\nš Found ${corrections.error_count} errors);`
})
.catch(error => console.error('Proofreading failed:', error));
`javascript
const service = new SharpApiProofreadService(process.env.SHARP_API_KEY);
const document =
The company annouced their new product line yesterday.
We recieved alot of positive feedback from customers.;
const statusUrl = await service.proofread(document);
const result = await service.fetchResults(statusUrl);
const corrections = result.getResultJson();
console.log('Error Report:');
corrections.errors.forEach((error, index) => {
console.log(\n${index + 1}. ${error.type.toUpperCase()}); Error: "${error.error}"
console.log(); Correction: "${error.correction}"
console.log(); Explanation: ${error.explanation}
console.log();`
});
`javascript
const service = new SharpApiProofreadService(process.env.SHARP_API_KEY);
const articles = [
{ title: 'Article 1', content: 'Your text here...' },
{ title: 'Article 2', content: 'More text...' },
{ title: 'Article 3', content: 'Even more text...' }
];
const proofreadResults = await Promise.all(
articles.map(async (article) => {
const statusUrl = await service.proofread(article.content);
const result = await service.fetchResults(statusUrl);
const corrections = result.getResultJson();
return {
title: article.title,
original: article.content,
corrected: corrections.corrected_text,
error_count: corrections.error_count
};
})
);
proofreadResults.forEach(result => {
console.log(${result.title}: ${result.error_count} errors corrected);`
});
---
- Content Creation: Ensure error-free blog posts, articles, and marketing copy
- Email Communication: Polish professional emails and messages
- Academic Writing: Improve essays, papers, and research documents
- Business Documents: Perfect reports, proposals, and presentations
- Social Media: Check posts for grammar and spelling before publishing
- E-commerce: Ensure product descriptions are error-free
- Customer Support: Validate support responses for clarity and correctness
---
The proofreader identifies various types of errors:
- Spelling errors: Typos, misspelled words
- Grammar mistakes: Subject-verb agreement, tense errors
- Punctuation: Missing or incorrect punctuation marks
- Capitalization: Proper noun capitalization, sentence starts
- Word choice: Commonly confused words (their/there/they're)
- Style issues: Redundancy, wordiness, clarity problems
---
POST /content/proofread`
For detailed API specifications, refer to:
- Postman Documentation
- Product Page
---
- @sharpapi/sharpapi-node-paraphrase - Text paraphrasing
- @sharpapi/sharpapi-node-translate - Text translation
- @sharpapi/sharpapi-node-summarize-text - Text summarization
- @sharpapi/sharpapi-node-client - Full SharpAPI SDK
---
This project is licensed under the MIT License. See the LICENSE.md file for details.
---
- Documentation: SharpAPI.com Documentation
- Issues: GitHub Issues
- Email: contact@sharpapi.com
---
Powered by SharpAPI - AI-Powered API Workflow Automation