Collectively, the present results disclose that E8 nanobody could target CDH17-overexpressing tumor tissues with excellent specificity and precision, and is a promising candidate agent for gastric cancer targeted imaging. This evidence concerns the gene CDH17 and gastric cancer.