Chemical analysis of raw wastewater in order to assess the presence of biological markers entering a wastewater treatment plant can provide objective information about the health and lifestyle of the population connected to the sewer system. This work was performed in a tropical country of Central America, Costa Rica, with the aim of extending this knowledge to new world regions. This work is the first to report wastewater-based epidemiological data on the use of illicit drugs in this region of the world. Composite wastewater samples from the influents of two different wastewater treatment facilities and surface water samples from surrounding areas were collected applying the best practice protocol and analysed to investigate the occurrence and fate of selected illicit drugs of abuse and pharmaceuticals. Results showed the presence of chemical indicators of the classic drugs cocaine and cannabis at high concentration levels, besides the moderate presence of the opiates codeine and morphine. Neither the worldwide commonly used psychoactive substances of abuse such as synthetic phenethylamines, nor pharmaceuticals from the family of benzodiazepines were detected, demonstrating the spatial differences in drug use among different world regions. In addition, effluent wastewater samples were analysed and compared to influent concentrations in order to evaluate the decrease in concentration of the targeted analytes through two treatment technologies. As a final step, a wide-scope qualitative screening, including hundreds of suspect compounds, was applied in order to have a better knowledge on the presence of pharmaceuticals in waters and to assess the potential impact of the treated wastewater into the receiving aquatic ecosystems.