An analysis of millions of Arabic-language tweets shows high levels of anti-Americanism in the Middle East, suggesting Twitter can be used to measure public sentiment in ways opinion polls cannot, scientists say.

The findings also highlight policy challenges — and opportunities — for the US in the Middle East, said Amaney Jamal, a professor of politics at Princeton University who conducted the research with colleagues at Harvard University.

“Can the US alter the image of itself in the region, especially in this era of terrorism where groups like ISIS are mobilising on anti-American platforms? The policy implications are serious,” Jamal said.

The researchers used a tool created by Boston—based social media analytics firm Crimson Hexagon to examine Arabic reaction on Twitter to major events in 2012 and 2013.

The events included Hurricane Sandy striking the US, the possible US intervention in the Syrian civil war, the firestorm over the “Innocence of Muslims video,” the Boston Marathon bombing and the removal of Egyptian President Mohamed Morsi.

Crimson Hexagon’s analytical tool used search terms and sample tweets organised by the researchers around each event to identify and categorise all relevant tweets mentioning the US from among every public posting on Twitter.

“If you want to know how people in a given society who are on Twitter are reacting to events in real time, this is a great way to find out, so long as there is no systematic censorship,” said Robert Keohane, a professor of public and international affairs at Princeton and one of the researchers.

The analytics tool identified and categorised more than 2.2 million Arabic tweets around the time of the overthrow of Morsi in 2013 that mentioned the US.

Just 3 per cent of the tweets were categorised as pro—American. About 23 per cent were categorised as neutral, but the rest were critical of the US, with criticism coming from backers of the Muslim Brotherhood and supporters of the Egyptian military, researchers said.

“No matter which side of the domestic dispute an individual was on, he or she was likely to be opposed to the US,” the researchers said.

“Rather than an enemy of an enemy being a friend, the US is consistently cast as an enemy,” they said.

Similarly, in analysing tweets regarding the Syrian civil war, “97 per cent of tweeters who expressed political views are antagonistic towards the US, despite the fact that the US opposed the Assad regime, which was also opposed by many Arab tweeters,” the researchers said.

In contrast, an examination of tweets in reaction to Hurricane Sandy striking the US found that nearly 30 per cent of Arabic tweets offering an opinion expressed concern about Americans, defended Americans or were positive towards the US government’s response.

“Reactions to cases where the US is influencing Middle Eastern affairs are 95 per cent to 99 per cent negative,” Keohane said.