It’s not a question anybody wants to ask, but if you regularly take medication and things don’t feel quite right, it would be an obvious one to type into a search engine. That’s certainly what Elad Yom-Tov from Microsoft Research thought when he set out to investigate whether search queries could be used to predict when a drug might be recalled.

Turns out, they can. To work that out, New Scientist reports that Yom-Tov trained an AI to establish connections between Bing queries made in each U.S. state relating to 300 different drugs and their recall over the course of eight months. Then, for another four months, he tested the AI to see if it could predict when a drug would be recalled by its manufacturer.

His algorithms were able to predict when a drug would be recalled, but only a day or two before it actually happened. “The most indicative attributes for prediction are sudden spikes in query volume about a specific medicine in each state,” Yom-Tov writes in a paper published on arXiv. “Recalls of prescription drugs and those estimated to be of medium-risk are more likely to be identified using search query data.”

While the technique can only predict recalls a couple of days in advance with accuracy, Yom-Tov tells New Scientist that it could be used as a monitoring tool much further out. Combined with other tests, it could provide drug companies and regulators with another means of detecting when something’s gone wrong with a batch of drugs.