Free plan

Detect Language

Find out which language the text in a picture or scan is in
POST
/v1/ai/ocr/detect-language

About this tool

This tool reads the text in a picture or scan and tells you which language it is written in. It mostly works by simple checks on the letters and common words, and uses an AI model (a computer program that understands text) only when it is unsure. You can ask it to straighten a tilted photo or clean up a noisy one first.
For example, you received a scanned letter in a language you do not know and you want to know which one it is before you translate it.

How to use it

  1. Choose this tool.
  2. Add your picture or scan with Upload, or drag and drop it.
  3. If the photo is tilted or noisy, turn on the straighten or clean up switches.
  4. Press Generate.
  5. Read the detected language.

What you get back

You get the name of the language, with how sure the tool is, as text on screen. You can copy it.
TEST IT LIVE

Try Detect Language in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
AI
Plan
Free
Method
POST
Endpoint
/v1/ai/ocr/detect-language
Tool ID
ai.ocr.detect-language
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Ai
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/ai/ocr/detect-language" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'files=@document.pdf' \
  -F 'on_unsupported=error' \
  -F 'quality=standard' \
  -F 'strategy=auto'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.ai.ocr.detectLanguage({
    "files": 'document.pdf',
    "on_unsupported": "error",
    "quality": "standard",
    "strategy": "auto"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->ai()->ocr()->detectLanguage([
    'files' => 'document.pdf',
    'on_unsupported' => 'error',
    'quality' => 'standard',
    'strategy' => 'auto',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Deterministic script + stopword detection on local OCR text; a model only when ambiguous. Readiness: unbenchmarked (see GET /v1/ai/capabilities/ocr.detect-language).

Classification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction (Poppler), Tesseract OCR with per-page confidence, Unicode script analysis, stopword language scoring.

Detect Language works from text and settings, so no file is needed. Every input is optional.

Detect Language is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/ai/ocr/detect-language with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.