It’s Monday morning, a few days before the famously bacchanalian Pride weekend kicks off in the Netherlands' biggest city.

Thys Roes and his friends are planning to party, and to that end they have purchased a bag of ecstasy pills.

At least they think the little pink Hello Kitty-shaped pills are ecstasy.

Story continues below advertisement

So the filmmaker has made his way to Jellinek Preventie, a rehab centre in central Amsterdam that, among other things, operates a drug-checking service.

Open this photo in gallery Pills which can't be immediately identified or are unfamiliar are sent to a drug-testing lab, which will determine the safe dosage and whether they contain adulterants. Rob Huibers/IAS

A counsellor scrapes a bit of the pill into a test tube and adds a liquid. It turns black.

Mr. Roes smiles, because it means the drug is, in fact, ecstasy (chemical name 3,4-methylenedioxymethamphetamine, or MDMA).

The counsellor also examines the pill closely and searches a computer database for a match.

Amsterdam is the global capital of ecstasy production and tablets have distinct branding. (Donald Trump-shaped pills are particularly popular these days.)

There is no record of the Hello Kitty pill so it will be sent to a drug-testing lab, which will determine the dosage and whether it contains adulterants.

The counsellor urges Mr. Roes to call back in a couple of days for detailed information on the drug’s potency.

Story continues below advertisement

There are 32 drug-checking services like this scattered around the Netherlands. Testing is anonymous, non-judgmental and free, except in Amsterdam where it costs €2.50 (or about $3.75).

Open this photo in gallery The Netherlands embraces harm reduction, a philosophy that holds it is better to help people use drugs safely and stay alive than to drive them to unsafe practices because of the fear of prosecution. Rob Huibers/IAS

“It’s a controversial but necessary service,” says Floor van Bakkum, manager of prevention at Jellinek.

While the Netherlands is legendarily liberal, most drugs, while tolerated for personal use, are still illegal, and that means the veracity and potency of products sold on the streets is unpredictable.

“People use drugs recreationally. That’s the reality. Testing makes it safer,” Ms. van Bakkum says.

The Netherlands, she says, embraces harm reduction: A philosophy that holds that it is better to help people use drugs safely and stay alive than it is to drive them to unsafe practices because of the fear of prosecution.

Daan van der Gouwe, a drug-policy researcher at the Trimbos Institute in Utrecht, says there is also an important utilitarian function.

Story continues below advertisement

“The purpose of drug-checking is twofold: To track what is being used and to identify health risks and issue health warnings if necessary.”

About 300 drug samples are tested and catalogued weekly, and about one-third are sent to a central lab for more detailed examination.

The information is shared with the Trans-European Drug Information Project, which has members from most of the dozen countries that offer drug-checking. (Drug testing strips can also be purchased in pharmacies and head shops around Amsterdam, but their accuracy is sometimes questionable.)

In the Netherlands, ecstasy is, by far, the most common drug being tested, accounting for 59 per cent of samples; 12 per cent are cocaine, 8 per cent methamphetamine, 6 per cent are 4-FA (a synthetic drug that was very popular in Europe a couple of years back), 4 per cent ketamine, 2 per cent LSD and the balance a variety of other substances.

Open this photo in gallery In the Netherlands, ecstasy is by far the most common drug being tested, accounting for 59 per cent of samples.

The Netherlands and other European countries that do drug-checking (Portugal, Spain, Belgium, Austria, Switzerland, Britain) see almost exclusively “party drugs,” and very little heroin, fentanyl or other opioids.

Dr. van der Gouwe says that’s because recreational users tend to plan their drug use and that groups are happy to sacrifice a pill or a bit of powder for testing to ensure they will be safe. Users of opioids, on the other hand, tend to be regular users (addicts, in the common parlance) and they are reluctant to give up any of their product.

Story continues below advertisement

In Canada, however, drug-checking, which is mostly done as part of pilot projects, focuses largely on detecting potentially lethal doses of fentanyl.

A study published last week found that 80 per cent of drugs sold as heroin in Vancouver actually contained no heroin, but caffeine and sugar laced with fentanyl. On the other hand, about 85 per cent of psychedelic drugs like MDMA submitted for testing were what they claimed.

That is roughly the rate seen in the Netherlands and elsewhere.

Dr. van der Gouwe says when drugs are not what they purport to be, it can be dangerous. In 2014, for example, “Pink Superman” tablets sold as ecstasy contained no MDMA but a potentially lethal dose of PMMA (para-Methoxy-N-methylamphetamine). There were more than a dozen deaths in Europe.

Monitoring shows party drugs are also getting remarkably stronger, Dr. van der Gouwe noted. For example, a normal dose of MDMA is about 80 milligrams but pills sold in Amsterdam now contain, on average, 167 mg.

Story continues below advertisement

While you can’t really overdose on ecstasy, high doses can result in serious health problems such as hyperthermia (heat stroke) and hyponatremia (excessive consumption of fluids) that have proved fatal for partygoers, particularly at raves.

Niels, a 37-year-old computer programmer and a regular client of the drug-checking service at Jellinek (he asked that his last name not be used), says he once brought in a sample of what he thought was ketamine but it turned out to be a much more potent drug.

“The test was a lifesaver,” he says.

This time around, he has purchased one gram of powder that is supposed to be MDMA, and he plans to split it into smaller doses to share with friends.

The drug check shows that the drug is indeed MDMA but a counsellor chats with Niels, particularly about the dangers of drinking too much water while high on ecstasy.

“This service is fast and easy, so why not be safe?” he says. “I got some really good advice too, and that should help me enjoy the party more.”