@sharpapi/sharpapi-node-proofread
v1.0.1
Published
SharpAPI.com Node.js SDK for proofreading text
Maintainers
Readme

Proofread & Grammar Checker API for Node.js
✍️ Fix grammar and spelling errors with AI — powered by SharpAPI.
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.
📋 Table of Contents
Requirements
- Node.js >= 16.x
- npm or yarn
Installation
Step 1. Install the package via npm:
npm install @sharpapi/sharpapi-node-proofreadStep 2. Get your API key
Visit SharpAPI.com to get your API key.
Usage
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();API Documentation
Methods
proofread(text: string, language?: string): Promise<string>
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: Status URL for polling the job result
Example:
const statusUrl = await service.proofread(textWithErrors, 'English');
const result = await service.fetchResults(statusUrl);Response Format
The API returns corrected text with detailed error information:
{
"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
}Examples
Basic Proofreading
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));Detailed Error Analysis
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()}`);
console.log(` Error: "${error.error}"`);
console.log(` Correction: "${error.correction}"`);
console.log(` Explanation: ${error.explanation}`);
});Batch Proofreading
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`);
});Use Cases
- 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
Detection Capabilities
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
API Endpoint
POST /content/proofread
For detailed API specifications, refer to:
Related Packages
- @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
License
This project is licensed under the MIT License. See the LICENSE.md file for details.
Support
- Documentation: SharpAPI.com Documentation
- Issues: GitHub Issues
- Email: [email protected]
Powered by SharpAPI - AI-Powered API Workflow Automation
