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

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 The former ProgrammableWeb Executive Editor, Adam is an API expert now helping regular people connect them at Zapier. Previously he worked at API companies SendGrid and Orchestrate, and wrote for Wired and Webmonkey. Adam is also the author of mapping API cookbook Map Scripting 101. Find him at AdamD.org.

Comments (1)


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


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