BackgroundSeveral observational studies have suggested that type 2 diabetes (T2D) is a risk factor for skin cancer, and antidiabetic drugs may reduce skin cancer risk. Nevertheless, the findings remain ambiguous. This Mendelian randomization (MR) study aimed to investigate the causal association of T2D with skin cancer and evaluate the potential impact of antidiabetic drug targets on skin cancer.MethodsGenetic variants associated with glycated hemoglobin (HbA1c), Type 2 Diabetes (T2D), and antidiabetic drug targets (KCNJ11, ABCC8, PPARG, INSR, GLP1R, SLC5A2, and DPP4) were sourced from genome-wide association studies in the UK Biobank and the DIAMANTE consortium. Genetic summary statistics on skin cancer were obtained from the FinnGen consortium. MR analysis was primarily performed leveraging the inverse-variance weighted method, with additional sensitivity analyses conducted. Summary data-based MR (SMR) was utilized to further investigate the association between antidiabetic drug target gene expression and skin cancer. Colocalization analysis was carried out to verify the robustness of the results.ResultsGenetically proxied elevated levels of HbA1c were found to be suggestively associated with a reduced risk of melanoma (OR: 0.886, 95% confidence interval (CI): 0.792–0.991, p = 0.0347). Additionally, genetically proxied T2D was notably associated with a lower risk of basal cell carcinoma (OR: 0.960, 95% CI: 0.928–0.992, p = 0.0147). The study also discovered that perturbation of the antidiabetic drug target SLC5A2 was significantly associated with an increased risk of basal cell carcinoma (for SLC5A2 perturbation equivalent to a 6.75 mmol/mol decrement in HbA1c: OR: 2.004, 95% CI: 1.270–3.161, p = 0.0027). However, this finding was not supported by colocalization analysis. Notably, no other drug target perturbations were found to be associated with skin cancer. Furthermore, SMR analysis failed to detect an association between antidiabetic drug target genes and skin cancer.ConclusionThe study suggests that higher HbA1c levels and T2D may be associated with a reduced risk of skin cancer. However, the results did not provide evidence to support the association between antidiabetic drug targets and skin cancer. Further evaluation of these drug targets is required to confirm the findings in this analysis.