But a small software company in Cape Town, South Africa predicted Donald Trump's win. And they called the British exit from the European Union too.

"Because Trump was such controversial figure, we had a suspicion that how he was resonating with people might be different from what traditional media was saying," says Jean Pierre Kloppers, the CEO of BrandsEye.

Like regular pollsters, BrandsEye focused on key battleground states. But they're not a polling company. Their day job is to track real-time social media sentiment for companies like Pizza Hut and Uber.

Companies, and some governments, pay BrandsEye to alert them to significant swings in sentiment to put out fires and identify opportunities.

Turns out politicians are like brands.

Using social media to track sentiment

Starting in July 2016, their machines used artificial intelligence (AI) to pull messages from social media feeds relevant to the US presidential campaign, primarily mentions of Hillary Clinton or Trump.

BrandsEye then put the word out to crowdsource human analysis of individual messages.

"We use people for what people are good at and machines for what machines are great at. And by using that interplay between the two, we are able to measure sentiment very deeply and by using computers we measure very deeply," says Kloppers.

JUST WATCHED 4 surprises that led to Trump's win Replay More Videos ... MUST WATCH 4 surprises that led to Trump's win 01:01

While AI is great for pulling in vast amounts of relevant data, it still struggles with sarcasm, innuendo and colloquial language.

They earn a few cents for each tweet they verify, earning around the same amount a waiter would for a day's work, says Kloppers.

Are social platforms more accurate than polling?

For their campaign prediction, they collected more than 37 million public social media conversations from four million authors -- mostly on Twitter.

And the combination of using AI to scrape social media data alongside crowdsourcing human verification of sentiment pointed squarely in Trump's direction.

Their analysis showed more negative sentiment towards Clinton coupled with strong positive advocacy for Trump. When all was counted and confirmed, the South African data firm claimed it had correctly predicted nine out of the eleven most competitive races.

Craig Raw, the founder of BrandsEye, says that people are often more honest on social media than in polling questionnaires, as their sentiment is largely unfiltered.

Of course, social media users don't necessarily represent the wider voting population, which is what the best polls try to measure. But as more people sign on, they believe it is useful to track trends in sentiment and volume of passion.

And Kloppers said that their technology shouldn't replace polling, but rather, work in conjunction with it.

In recent days, critics have called out social media companies for helping create a so-called "echo-chamber" in people's feeds and the role of fake news in whipping up voter enthusiasm.

Raw adds: "Social media really represents what people are saying. Regardless of whether they are reading a story that is true or false, nevertheless it represents an emotion and they are going to vote on that emotion."