A pilot project to test the strength and purity of recreational drugs was launched in Berlin on Thursday, a spokeswoman said.
Recreational drugs are chemical substances taken for enjoyment, or leisure purposes, rather than for medical reasons.
They can lead to addiction, to health and social problems and to crime; most are illegal.
The “drug-checking’’ project aims to provide one official location where drugs such as ecstasy can be chemically analysed, according to the spokeswoman for the Berlin Senate Department for Health, Care and Equality.
The city’s administration has been considering such a move for some time to protect clubbers from tainted or particularly powerful drugs.
According to the health administration, the aim is to obtain as much accurate information as possible about the ingredients in the drugs and their dosages and to publicise the results.
The project will receive $34,000 (30,000 euros) of funding in 2018 and 120,000 euros in 2019.
It is being run by organisations in Berlin working in the areas of drugs and addiction.
However, there remain some legal issues to iron out before the project is rolled out.
Because of the legal situation in Germany, Berlin needs special permission from the Federal Institute for Medicines and Medical Products.
In other countries like Switzerland, drug-checking has been around for years.
There, online warnings are issued when high-dose pills are in circulation, for example.
A survey commissioned by the Berlin Senate showed that partygoers in Berlin are widely using drugs such as cannabis, amphetamines and ecstasy.