It might be tempting to purchase your medicines from an online pharmacy to save money, but beware. Some online pharmacies are selling ineffective and even dangerous products.

The National Association of Boards of Pharmacy (NABP) reported this year that it identified dozens of illicit online pharmacies (IOPs) selling drugs marketed as treatments for COVID-19, drugs that would normally require a prescription.

“Rogue internet pharmacy networks are run by criminal opportunists, and the coronavirus disease 2019 (COVID-19) pandemic has provided the perfect opportunity for illegal online drug sellers to prey on fearful consumers,” the NABP says in its “Rogue Rx Activity Report.”

But now, researchers at Penn State University have developed an algorithm that may be able to identify which online pharmacies are legitimate and which ones are not. They wrote about their findings in the Journal of Medical Internet Research.

IOPs are a serious problem, says Soundar Kumara, Ph.D., the Allen E. Pearce and Allen M. Pearce Professor of Industrial Engineering. Illegal pharmacies can, for example, sell unwitting customers drugs mixed with ineffective ingredients like corn starch.

“If they’re adulterated,” says Kumara, “you cannot get the right dosage. So the effectiveness of the drug could be wrong, and, people could die.”

“In addition, some expensive drugs can be counterfeited,” he says. “So, for example, if someone wants to buy a drug for an immune-compromised disease that costs $3,000, and they go online and the online pharmacy says, ‘We can give you the drug for $1,000,’ that person may feel that it’s great and get it, but it might not have the potency that is needed.”

Moreover, some IOPs sell highly addictive drugs such as oxycodone and other opioids without the required prescription from a physician, Kumara says.

“So, there are so many problems associated with having IOPs,” he says.

In a warning letter from the Food and Drug Administration (FDA) in September, the agency notified a number of rogue online pharmacies that they were in violation of the U.S. Food, Drug and Cosmetic Act by:

“Offering for sale unapproved prescription drugs of unknown origin, safety, and effectiveness; offering prescription drugs without a prescription; offering prescription drugs without adequate directions for safe use; and offering prescription drugs without FDA-required warnings to consumers about the serious health risks associated with the prescription drug.”

In its BeSafeRx campaign, the FDA says, “A safe, legal internet pharmacy always requires a doctor’s prescription, has a physical address and phone number in the United States, is licensed by the state where they are doing business and has a state-licensed pharmacist on staff to answer questions by the patient.”

But catching and stopping IOPs is difficult for several reasons, says Hui Zhao, Ph.D., a Penn State associate professor of supply chain and information systems and the Charles and Lilian Binder Faculty Fellow in the Smeal College of Business.

“Nobody really knows how many are out there,” she says. “But there are at least 30,000 to 35,000.”

“But we don’t really know because of the dynamic nature of online pharmacies,” she says. “Online markets come and go easily. They disappear here and pop us somewhere else with a different URL.”

So Kumara, Zhao and Sowmyasri Muthupandi, a former research assistant, developed an algorithm to distinguish IOPs from the legal online pharmacies.

Using a dataset of 763 online pharmacy websites, the researchers examined web traffic and engagement data to observe the different ways consumers find and engaged with the online pharmacies. In particular, they focused on referral links between websites.

If customers consistently come upon an online pharmacy through referral links that regularly link to illicit pharmacies, chances are the online pharmacy is also illicit, Zhao says.

“On the other hand,” says Zhao, “if I find that website X has been referenced by a site that mostly refers to the legal ones, then I would say there’s a higher likelihood that X is a legal one.”

“Think about your social network,” she says. “If a person hangs out with bad guys, then likely, if he hangs out with another person, that person likely belongs to this similar group.”

Their prediction models achieved an accuracy rate of more than 95%in identifying IOPs, she says. The prediction models could have many applications, Kumara and Zhao say.

In their journal article, they write that search engines, online retailers as well as credit card and other payment companies could someday use the models to either filter out IOPs or consider the status of an online pharmacy when ranking search results.

The tool could also be used to fashion a warning system that could notify consumers as to which pharmacies are legal and which ones are not, they say.

“Policy makers, government agencies, patient advocacy groups and drug manufacturers may also use such a system to identify, monitor, curb IOPs, and educate consumers.”