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

Adam DuVander
Sep. 15 2009, 02:30AM EDT

Did 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 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.

Adam DuVander Hi! I'm Developer Communications Director for SendGrid and former Executive Editor of ProgrammableWeb. I currently serve as a Contributing Editor. If you have API news, or are interested in writing for ProgrammableWeb, please contact editor@programmableweb.com Though I'm a fan of anything API-related, my particular interest is in mapping. I've published a how-to book, Map Scripting 101, to get anyone started making maps on websites. In a not-so-distant past life I wrote for Wired and Webmonkey.