> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hobbo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Language Detection

> Detect the primary language of input text using AI. Supports multilingual text, transliterated text, mixed languages, and handles various edge cases. Returns ISO 639-1 two-letter language code.



## OpenAPI

````yaml POST /features/language-detection
openapi: 3.1.0
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.hobbo.ai
    description: Main API server
  - url: https://py-api.hobbo.ai
    description: Python API server for scraper endpoints
security:
  - ApiKeyAuth: []
paths:
  /features/language-detection:
    post:
      description: >-
        Detect the primary language of input text using AI. Supports
        multilingual text, transliterated text, mixed languages, and handles
        various edge cases. Returns ISO 639-1 two-letter language code.
      requestBody:
        description: Language detection parameters
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LanguageDetectionRequest'
        required: true
      responses:
        '200':
          description: Language detected successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LanguageDetectionResponse'
        '400':
          description: Validation error or unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                validationError:
                  value:
                    error: review_text is required
        '404':
          description: Language could not be detected
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                detectionError:
                  value:
                    error: >-
                      We couldn't able to detect the language on input text.
                      Please try again with a different text.
        '504':
          description: Request timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                timeoutError:
                  value:
                    error: >-
                      It seems like the request is taking longer than usual.
                      Please try again later.
      servers:
        - url: https://py-api.hobbo.ai
components:
  schemas:
    LanguageDetectionRequest:
      type: object
      required:
        - review_text
      properties:
        review_text:
          type: string
          description: >-
            The text to detect the language for. Can be plain text, mixed
            languages, transliterated text, or code-switched content.
        review_id:
          type:
            - string
            - 'null'
          description: Optional identifier for tracking the language detection request
    LanguageDetectionResponse:
      type: object
      properties:
        lang:
          type: string
          description: >-
            language code (e.g., 'en', 'es', 'fr', 'hi') representing the
            detected primary language of the input text
    Error:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
        data:
          type: object
          description: Empty object or additional error data
        success:
          type: boolean
          description: Indicates operation failed
          example: false
        message:
          type: string
          description: Error message describing what went wrong

````