Apatinib has been proven to be effective and safe among patients in the third-line treatment of advanced gastric cancer in phase II and III trials. We aimed to evaluate its efficacy and safety in second-line practice, and to explore the factors associated with efficacy. Between April 2015 and May 2017, a total of 23 patients with advanced gastric adenocarcinoma or adenocarcinoma of gastroesophageal junction were enrolled and followed up retrospectively after failing the first line of systemic therapy. The median progression-free survival was 4.43 months (95% confidence interval: 1.63–7.22) and the median overall survival was 9.11 months (95% confidence interval: 8.22–9.99). Two patients achieved a partial response and 14 patients achieved stable disease. The disease control rate was 69.6% and the objective response rate was 8.7%. The most common adverse events over grade 3 were hypertension (8.7%) and thrombocytopenia (8.7%). No treatment-related death was documented during the drug administration. Apatinib is an effective regimen for the second-line treatment of advanced gastric and gastroesophageal cancer with manageable toxicity.