Carotenoids are indispensable to plants and essential for human nutrition and health. Carotenoid contents are strongly influenced by light through light-responsive genes such as B-Box (BBX) genes. BBX proteins, a class of zinc-finger transcription factors, mediate many light-signaling pathways, leading to the biosynthesis of important metabolites in plants. However, the identification of the BBX gene family and expression analysis in response to photoperiod-mediated carotenoid accumulation in cucumber remains unexplored. We performed a genome-wide study and determined the expression of cucumber BBX genes (hereafter referred to as CsaBBXs genes) in the endocarp of Xishuangbanna cucumber fruit (a special type of cucumber accumulating a high level of β-carotene in the endocarp) using an RNA-seq analysis of plants previously subjected to two photoperiodic conditions. Here, 26 BBX family genes were identified in the cucumber genome and named serially CsaBBX1 through CsaBBX26. We characterized CsaBBX genes in terms of their phylogenetic relationships, exon-intron structures, cis-acting elements, and syntenic relationships with Arabidopsis thaliana (L.) Heynh. RNA-seq analysis revealed a varied expression of CsaBBX genes under photoperiod treatment. The analysis of CsaBBXs genes revealed a strong positive correlation between CsaBBX17 and carotenoid biosynthetic pathway genes (phytoene synthase, ζ-carotene desaturase, lycopene ε-cyclase, β-carotene hydroxylase-1), thus suggesting its involvement in β-carotene biosynthesis. Additionally, nine CsaBBX genes (CsaBBX 4,5,7,9,11, 13,15,17 and 22) showed a significant positive correlation with β-carotene content. The selected CsaBBX genes were verified by qRT-PCR and confirmed the validity of RNA-seq data. The results of this study established the genome-wide analysis of the cucumber BBX family and provide a framework for understanding their biological role in carotenoid accumulation and photoperiodic responses. Further investigations of CsaBBX genes are vital since they are promising candidate genes for the functional analysis of carotenoid biosynthesis and can provide genetic tools for the molecular breeding of carotenoids in plants.