Elon Musk Wants to Kill My Magic 8 Ball

The API paywall spells doom for Twitter bots, including mine

Michael Fitzmaurice
4 min readFeb 8, 2023
Image generated by DALL-E

Dabbling in The Occult

Almost ten years ago, I made a Magic 8 Ball Twitter bot. There was nothing much to it - just a fun weekend project using a freely available API to create a trivial app.

I wrote it in Java, using Twitter4J to talk to the Twitter API and Prevayler for persistence. When you launch the app, it:

  • authenticates to the Twitter API using OAuth creds from a local file
  • queries the API for new questions/mentions
  • replies to each question with a response chosen randomly from the 20 standard answers (and yes, there is a standard for Magic 8 Ball answers…)
  • exits

Dead simple.

I deployed it to a tiny EC2 instance and scheduled it to run every two minutes via cron. Tweet it a yes/no question, wait a maximum of two minutes, and behold — Magic 8-Ball bestows its mystical wisdom upon you!

That’s profound, man.

Having scratched the itch to build my bot, I pretty much forgot about it. It has been sitting in Twitter obscurity for all these years, ready when called upon but seldom used.

It May Predict the Future, but It Didn’t See That Coming

A few days ago, Twitter gave one week’s notice of their intention to move the API behind a paywall—no more free access (still no pricing details). The rug my bot stands upon is about to be pulled brusquely from under its feet. One might call it a nasty kick in the 8-balls.

Of course, I am not the only one affected. Like Obi-Wan sensing the terrible fate of the planet Alderaan, I felt a great disturbance in the Force, as if millions of Twitter voices suddenly cried out in terror and anger. Mostly anger. And often expressed on Twitter itself.

How Did We Get Here?

The Twitter API has been around since 2006. Between then and now, an enormous number of apps have been developed on top of it. Twitter’s developer blog encouraged devs to create apps that use the API to increase engagement with the platform. “Come, build, create!” they told us, “The more, the merrier!”.

And so we created a veritable army of Twitter bots that use the API in various creative ways, from posting live earthquake information, to tweeting hourly pictures of cute possums, to monitoring the comings and goings of a domestic cat in France. Somewhere in that unruly crowd of bots stands my own Magic 8 Ball.

“Magic Ball Sphere” image by Candace McDaniel, reproduced under the CC0 license

And it’s not just bots. Researchers have also used the Twitter API for all kinds of things, for example, in-depth analysis of public sentiment towards the candidates in an election or predicting the onset of mental illness.

A rich and varied ecosystem indeed.

A New Hope?

That brings us to last week’s announcement.

Since then, Elon Musk has hinted that free access might be maintained for bots that write to the API rather than read from it, but only the ones providing “good content”. Hmm — does that include my Magic 8 Ball?

Presumably, the rationale is that reading takes from Twitter, whereas writing contributes to it.

That doesn’t help my bot; most of its interactions with the API are reads (polling to discover new questions to answer). Only when it finds new questions does it make any write requests, and that happens rarely.

Farewell and Adieu to You, Fair Spanish Ladies

So that’s probably it for my Magic 8 Ball. Curtains. The odds of it being given a pass look slim, and the odds of me paying 100+ dollars/month to maintain it are slimmer still.

It’s not a tragedy, granted, but a shame nonetheless.

But far worse than depriving the World of a novelty toy bot like mine, this change to the Twitter API risks killing much more valuable bots that make it easier to read long threads or return to individual tweets. An ecosystem diminished rather than enhanced.

With the doomsday clock counting down to this looming deadline, this scheduled day of mayhem, this new Twitter… APIcalypse, it seemed only fair to inform Magic 8-Ball of its fate. I will save the eulogies and instead leave the last word to my old bot friend, a valediction before it falls silent forever:

I think it may have become self-aware…

--

--

Michael Fitzmaurice

I'm a software engineer in Arup's City Modelling Lab, where we use agent-based models to help improve transport and cities.