Grammar Check API - Dart/Flutter Client

Grammar Check is a grammar checker and spell check API for English text that inspects text for spelling and grammar errors, returning the corrected wording, error count, and a modified flag. Paid plans add detailed rule descriptions, character offsets, and suggestions for every detected mistake.

pub package License: MIT

This is the Dart/Flutter client for the Grammar Check API.

Installation

Add this to your pubspec.yaml:

dependencies:
  apiverve_grammarcheck: ^1.2.6

Then run:

dart pub get
# or for Flutter
flutter pub get

Usage

import 'package:apiverve_grammarcheck/apiverve_grammarcheck.dart';

void main() async {
  final client = GrammarcheckClient('YOUR_API_KEY');

  try {
    final response = await client.execute({
      'text': 'The the pig snorted when I saw it on the barn gate. I was a little mad becuase it woke up my pupppppy'
    });

    print('Status: ${response.status}');
    print('Data: ${response.data}');
  } catch (e) {
    print('Error: $e');
  }
}

Response

{
  "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"
        ]
      }
    ]
  }
}

API Reference

Authentication

All requests require an API key. Get yours at apiverve.com.

License

MIT License - see LICENSE for details.


Built with Dart for APIVerve

Libraries

apiverve_grammarcheck
Grammar Check API client for Dart/Flutter