Purpose Heart failure is among the leading causes for hospitalization in Europe. In this study, we evaluate potential precipitating factors for hospitalization for heart failure and shock. Methods Using Swiss claims data (2014-2015), we evaluated the association between hospitalization for heart failure and shock, and prescription of oral potassium supplements, non-steroidal anti-inflammatory drugs (NSAIDs), and amoxicillin/clavulanic acid. We conducted case-crossover analyses, where exposure was compared for the hazard period and the primary control period (e.g., 1-30 days before hospitalization vs. 31-60 days, respectively). Conditional logistic regression was applied and subsequently adjusted for addressing potential confounding by disease progression. Sensitivity analyses were conducted and stratification for co-medication was performed. Results We identified 2185 patients hospitalized with heart failure or shock. Prescription of potassium supplements, NSAIDs, and amoxicillin/clavulanic acid was significantly associated with an increased risk for hospitalization for heart failure and shock with crude odds ratios (OR) of 2.04 for potassium (95% CI 1.24-3.36, p = 0.005, 30 days), OR 1.8 for NSAIDs (95% CI 1.39-2.33, p < 0.0001, 30 days), and OR 3.25 for amoxicillin/clavulanic acid (95% CI 2.06-5.14, p < 0.0001, 15 days), respectively. Adjustment attenuated odds ratios, while the significant positive association remained (potassium OR 1.70 (95% CI 1.01-2.86, p = 0.046), NSAIDs OR 1.50 (95% CI 1.14-1.97, p = 0.003), and amoxicillin/clavulanic acid OR 2.26 (95% CI 1.41-3.62, p = 0.001). Conclusion Prescription of potassium supplements, NSAIDs, and amoxicillin/clavulanic acid is associated with increased risk for hospitalization. Underlying conditions such as pain, electrolyte imbalances, and infections are likely contributing risk factors. Physicians may use this knowledge to better identify patients at risk and adapt patient management.