In the present study, we identified two CDH17 nanobodies and used them to develop imaging and therapeutic strategies for gastric cancer expressing CDH17. Here, CDH17 is linked to gastric cancer.