The aim of this study was to reveal genes associated with breast cancer metastasis, to investigate their intrinsic relationship with immune cell infiltration in the tumor microenvironment, and to screen for prognostic biomarkers. Gene expression data of breast cancer patients and their metastases were downloaded from the GEO, TCGA database. R language package was used to screen for differentially expressed genes, enrichment analysis of genes, PPI network construction, and also to elucidate key genes for diagnostic and prognostic survival. Spearman's r correlation was used to analyze the correlation between key genes and infiltrating immune cells. We screened 25 hub genes, FN1, CLEC5A, ATP8B4, TLR7, LY86, PTGER3 and other genes were differentially expressed in cancer and paraneoplastic tissues.However, patients with higher expression of CD1C, IL-18 breast cancer had a better prognosis in the 10 years survival period, while patients with high expression of FN1, EIF4EBP1 tumors had a worse prognosis. In addition, TP53 and HIF1 genes are closely related to the signaling pathway of breast cancer metastasis. In this study, gene expression of ATP8B4 and CD1C were correlated with cancer tissue infiltration of CD8 + T lymphocytes, while GSE43816, GSE62327 and TCGA databases showed that CD8 + T lymphocytes were closely associated with breast cancer progression. Functional enrichment analysis of genes based on expression differences yielded key genes of prognostic value in the breast cancer microenvironment.