To our knowledge, this is one of the few real-world studies to reveal the relationship between IL-6 and the effectiveness of ICIs, focusing on gastric and esophageal cancer. This evidence concerns the gene IL6 and esophageal cancer.