LanguageTool Check API

The Check API from LanguageTool — 1 operation(s) for check.

OpenAPI Specification

languagetool-check-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: LanguageTool HTTP Check API
  description: LanguageTool checks texts for style and grammar issues. The HTTP API provides programmatic access to grammar checking, language detection, and personal dictionary management.
  version: '1.0'
  contact:
    name: LanguageTool
    url: https://languagetool.org/http-api/
  license:
    name: LGPL-2.1
    url: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
servers:
- url: https://api.languagetool.org/v2
  description: Public LanguageTool API
- url: https://api.languagetoolplus.com/v2
  description: LanguageTool Plus (Premium) API
tags:
- name: Check
paths:
  /check:
    post:
      summary: Check text for grammar and style issues
      description: Checks a text for style and grammar issues. Returns a list of matches with messages, suggested replacements, and rule context.
      operationId: checkText
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
              - language
              properties:
                text:
                  type: string
                  description: The text to be checked. Either text or data is required.
                data:
                  type: string
                  description: The text to be checked, given as a JSON document containing formatting markup.
                language:
                  type: string
                  description: A language code like en-US, de-DE, or fr. Use auto for automatic language detection.
                  example: en-US
                username:
                  type: string
                  description: Username for premium API access.
                apiKey:
                  type: string
                  description: API key for premium API access.
                level:
                  type: string
                  enum:
                  - default
                  - picky
                  description: Detection level. Use picky for more issues to be detected.
                enabledRules:
                  type: string
                  description: Comma-separated list of rule IDs to enable.
                disabledRules:
                  type: string
                  description: Comma-separated list of rule IDs to disable.
                enabledCategories:
                  type: string
                  description: Comma-separated list of category IDs to enable.
                disabledCategories:
                  type: string
                  description: Comma-separated list of category IDs to disable.
                preferredVariants:
                  type: string
                  description: Preferred language variants (e.g. en-US, de-DE).
                motherTongue:
                  type: string
                  description: Native language code for false friends checks.
      responses:
        '200':
          description: Successful response with check results.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckResponse'
        '400':
          description: Bad request.
        '429':
          description: Rate limit exceeded.
      tags:
      - Check
components:
  schemas:
    Context:
      type: object
      properties:
        text:
          type: string
        offset:
          type: integer
        length:
          type: integer
    Replacement:
      type: object
      properties:
        value:
          type: string
    CheckResponse:
      type: object
      properties:
        software:
          $ref: '#/components/schemas/Software'
        language:
          type: object
          properties:
            name:
              type: string
            code:
              type: string
            detectedLanguage:
              $ref: '#/components/schemas/DetectedLanguage'
        matches:
          type: array
          items:
            $ref: '#/components/schemas/Match'
    Software:
      type: object
      properties:
        name:
          type: string
        version:
          type: string
        buildDate:
          type: string
        apiVersion:
          type: integer
        premium:
          type: boolean
        status:
          type: string
    Rule:
      type: object
      properties:
        id:
          type: string
        subId:
          type: string
        description:
          type: string
        urls:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
        issueType:
          type: string
        category:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
    Match:
      type: object
      properties:
        message:
          type: string
        shortMessage:
          type: string
        offset:
          type: integer
        length:
          type: integer
        replacements:
          type: array
          items:
            $ref: '#/components/schemas/Replacement'
        context:
          $ref: '#/components/schemas/Context'
        sentence:
          type: string
        type:
          type: object
          properties:
            typeName:
              type: string
        rule:
          $ref: '#/components/schemas/Rule'
        ignoreForIncompleteSentence:
          type: boolean
        contextForSureMatch:
          type: integer
    DetectedLanguage:
      type: object
      properties:
        name:
          type: string
        code:
          type: string
        confidence:
          type: number