A variety of substances can be detected in nails, including heavy metals like arsenic, lead, and mercury. Drugs like cocaine and opioids can also be detected. Environmental toxins and certain nutritional deficiencies are other conditions that can be identified through nail analysis.