Skip to main content

Twitter API will get language detection and ‘top tweets’ filtering

twitter code
Image used with permission by copyright holder

Twitter’s API is getting two important additions to its metadata, the company announced via blog post. Developers can now detect a tweet’s language, as well as algorithmic curation to surface “high value” tweets.

First off, to detect the language of a tweet, the updated API uses Twitter’s machine language detection algorithm, which should help developers better serve its users (especially to an international crowd) with language specific aggregation, analysis, and curation of tweets. For instance, developers can manually pick out the types of languages that they’d like to have surface in their app while burying tweets from unspecified languages. In one scenario, the parameter “language=ja” would display only tweets in the Japanese language. If you’re wondering where the “ja” abbreviation comes from, Twitter uses the two-letter ISO 639-1 code, which corresponds to certain languages.

twitter meta data for language detection
Image used with permission by copyright holder

Twitter’s second update will offer developers the option to choose from “none,” “low,” “medium,” and “high” values, meaning that developer can tell Twitter how much they’d like to filter streaming tweets. This part of the API would be used to separate the important tweets from the noise in high-volume feeds, per Twitter’s own algorithm which sorts “high value” tweets from the rest. To get a better sense of what the values mean, Twitter’s “Developer Advocate,” Arne Roomann-Kurrik, writes that the medium entries, “roughly correlate to the ‘Top Tweets’ results for searches on twitter.com.”

This piece of info clues us into what’s actually powering the streams. Early last month, Twitter revealed that its real-time search engine was partially human powered (via Amazon’s Mechanical Turk) to better add context to tweets. The human element, for now, is the best and fastest way to add context to topics like “binders full of women,” which may suddenly have a new meaning overnight.

To get a better sense of how Twitter’s human search engine plays into this updated API, we’ll have to get technical for a moment. Developers can set one of the four values mentioned above, which in the code would sit next to the “filter_level” parameter. If “filter_level”: “none” then this defines no filtering. “Medium” on the other hand offers the most filtering, and if a developer has chosen the “medium” parameter, all “Top Tweets” that Twitter spits out into the developer’s client are search results that have been influenced by Twitter’s human real-time search engine.

For now, it looks like a “high” value doesn’t yet correspond to any amount of filtering. But say that “medium” does correspond to the human powered search results, which Roomann-Kurrik seems to suggest. That would mean that Twitter for now is setting aside a type of filter that would be far more powerful than “medium.” So any development here is worth keeping an eye on.

The “value” based filters will be launching on February 20, and the language filter will follow shortly thereafter, although a hard date hasn’t yet been set for that.

Editors' Recommendations

Francis Bea
Former Digital Trends Contributor
Francis got his first taste of the tech industry in a failed attempt at a startup during his time as a student at the…
How to use Twitter Circle to limit who sees your tweets
A person's hands holding a smartphone as they browse Twitter on it.

Now that Twitter Circle has officially launched globally, you're probably wondering how to use it and what it actually lets you do. Twitter Circle essentially lets you tweet to a specific audience on Twitter, an audience in which all the members are picked by you. That way, you don't have to tweet your shower thoughts and hot takes to everyone on the bird app. You can keep it just between you and a bunch of your favorite fellow Twitter users.

In this guide, we'll go over everything you need to know about Twitter Circle, including what it is, how to set it up, and how to send a tweet to your own Twitter Circle.

Read more
Edited tweets may be coming to your Twitter timeline soon
Twitter app on the OnePlus 10T.

You may soon see edited tweets on your timeline because Twitter has begun testing its Edit Tweet feature.

On Thursday, Twitter offered up an update on its long-awaited tweet editing feature via a tweet and a blog post. Twitter published a blog post that details the nature of the test and what the current version of the Edit Tweet feature entails.

Read more
Twitter statuses can warn people when your tweet is a hot take
A Twitter icon on a blue background on a smartphone's screen, all on a white background.

Remember that AIM away message-like status feature Twitter was spotted working on a few months back? It looks a bit different now and is finally being tested with some Twitter users. Based on screenshots we've seen shared on Twitter, it looks less like AIM and more like Facebook's "How are you feeling?" statuses.

On Wednesday afternoon, TechCrunch reported that there were Twitter users "reporting that they can now post Twitter statuses, which lets them tag posts like they’re retro MySpace moods."

Read more