We present a x-ray absorption near-edge structure study (XANES) at Ce L3-, and Co K-edges of CeCo2 thin films with the thickness varying from 30nm to 140nm. The Ce L3-edge measurements exhibit the mixed valence nature and tetravalent contribution that increases with the thickness of CeCo2. The variation in the spectral intensity observed at Co K-edge threshold indicates that there is a change in 3d occupancy and also in 3d-4f-5d hybridization. This study shows the effect of surface to bulk ratio and how it influences the charge transfer between Ce and Co ions and hence the electronic structure of CeCo2 thin films.