What Language Are You Speaking? There’s an API for That

Adam DuVander, September 15th, 2009

LangIdDid you know that leraar is a Dutch word? A new API, LangID can help you with those pesky language identification problems. Feed it a string of text and the API returns the name of the language, its ISO code and even an image of the flag for a country that speaks the language (the latter could be a hot-button political issue–watch out). You can choose your output as either XML or browser-friendly JSON (more technical details at our LangID API profile).

langid_scr

LangID is a very straightforward API, and lthough it stops short of providing actual translation, it could conceivably be used along with translation services like the Google AJAX Language API or the Microsoft Translator API.

In terms of accuracy, the service becomes more reliable the longer the block of text you provide (you must include at least five characters). For example, it may not always help you match foods to countries: “No burrito” returned as English, while LangID claimed “lasagna” is Icelandic.

The API is just one of the many ways that LangID provides language identification. You can also use its website, Twitter, or a few other methods. Knowing which language to use is a first step to translating, and perhaps LangID will add in the second step – the actual translation – with its next iteration.

Both comments and pings are currently closed.

One Response to “What Language Are You Speaking? There’s an API for That”

September 15th, 2009
at 9:54 am
Comment by: Elliot

Also check out AlchemyAPI’s language detection API. Detects more languages (97) than Google’s Language API or LangID, with higher accuracy.

http://www.alchemyapi.com/api/lang/

Also offers commercial use / SLA, something not available elsewhere.

Follow the PW team on Twitter

ProgrammableWeb
APIs, mashups and code. Because the world's your programmable oyster.

John Musser
Founder, ProgrammableWeb

Adam DuVander
Executive Editor, ProgrammableWeb. Author, Map Scripting 101. Lover, APIs.