Language Detector API - Dart/Flutter Client

Language Detector is a language detection API that identifies the language of any submitted text string. It returns the primary language, its ISO 639-1 code, and candidate matches ranked by confidence scores.

pub package License: MIT

This is the Dart/Flutter client for the Language Detector API.

Installation

Add this to your pubspec.yaml:

dependencies:
  apiverve_languagedetector: ^1.2.4

Then run:

dart pub get
# or for Flutter
flutter pub get

Usage

import 'package:apiverve_languagedetector/apiverve_languagedetector.dart';

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

  try {
    final response = await client.execute({
      'text': 'esta es una frase en español. esta API puede detectar fácilmente el idioma'
    });

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

Response

{
  "status": "ok",
  "error": null,
  "data": {
    "primaryLanguage": "spanish",
    "primaryCode": "es",
    "confidenceLevel": "medium",
    "detectedLanguages": [
      {
        "language": "spanish",
        "confidence": 0.38471794871794873,
        "code": "es"
      },
      {
        "language": "portuguese",
        "confidence": 0.2946153846153846,
        "code": "pt"
      },
      {
        "language": "danish",
        "confidence": 0.2464615384615384,
        "code": "da"
      }
    ]
  }
}

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_languagedetector
Language Detector API client for Dart/Flutter