Sapling Logo
Grammar API quickstart

Bash / Unix Shell Grammar Checker

Add spelling and grammar suggestions to a Bash / Unix Shell application with Sapling's edits API.

  • HTTPS POST
  • HTTP API
  • API key required
POST Bash / Unix Shell logo Bash / Unix Shell /api/v1/edits

Bash / Unix Shell grammar checker quickstart

Send text to the edits endpoint. Sapling returns suggested replacements with character offsets so your application can review or apply each correction.

No language-specific SDK is required. The example uses a standard or commonly used HTTP client to call Sapling's JSON API.
Bash / Unix Shell /api/v1/edits
curl \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"key": "<API_KEY>", "text": "Lets get started!", "session_id": "Test Document UUID"}' \
  https://api.sapling.ai/api/v1/edits
Example response application/json
{
  "edits": [
    {
      "start": 0,
      "end": 4,
      "replacement": "Let's",
      "sentence": "Lets get started!",
      "error_type": "R:OTHER"
    }
  ]
}

Each edit identifies the source range and replacement text. Preserve the original offsets when applying more than one edit.

About Bash / Unix Shell

Bash is a command-line interpreter that provides an interface for Unix-like operating systems. It's a popular scripting language for Unix, Linux, and macOS.