This work reports a fundamental study on the electronic structure, optical properties, and defect chemistry of a series of Co-based spinel oxide (${\mathrm{Co}}_{3}{\mathrm{O}}_{4}, {\mathrm{ZnCo}}_{2}{\mathrm{O}}_{4}$, and ${\mathrm{CoAl}}_{2}{\mathrm{O}}_{4}$) epitaxial thin films using x-ray photoemission and absorption spectroscopies, optical spectroscopy, transport measurements, and density functional theory. We demonstrate that ${\mathrm{ZnCo}}_{2}{\mathrm{O}}_{4}$ has a fundamental bandgap of 1.3 eV, much smaller than the generally accepted values, which range from 2.26 to 2.8 eV. The valence band edge mainly consists of occupied $\mathrm{Co}\phantom{\rule{0.28em}{0ex}}3d\phantom{\rule{0.28em}{0ex}}{t}_{2\mathrm{g}}^{6}$ with some hybridization with O $2p$/Zn $3d$, and the conduction band edge of unoccupied ${e}_{g}^{*}$ state. However, optical transition between the two band edges is dipole forbidden. Strong absorption occurs at photon energies above 2.6 eV, explaining the reasonable transparency of ${\mathrm{ZnCo}}_{2}{\mathrm{O}}_{4}$. A detailed defect chemistry study indicates that Zn vacancies formed at high oxygen pressure are the origin of a high $p$-type conductivity of ${\mathrm{ZnCo}}_{2}{\mathrm{O}}_{4}$, and the hole conduction mechanism is described by small-polaron hoping model. The high $p$-type conductivity, reasonable transparency, and large work function make ${\mathrm{ZnCo}}_{2}{\mathrm{O}}_{4}$ a desirable $p$-type transparent semiconductor for various optoelectronic applications. Using the same method, the bandgap of ${\mathrm{Co}}_{3}{\mathrm{O}}_{4}$ is further proved to be \ensuremath{\sim}0.8 eV arising from the tetrahedrally coordinated ${\mathrm{Co}}^{2+}$ cations. Our work advances the fundamental understanding of these materials and provides significant guidance for their use in catalysis, electronic, and solar applications.