We studied the effective contact potential difference (ECPD) of thin film nanostructures and its role in self-powered X-ray sensors, which use the high-energy current detection scheme. We compared the response to kilovoltage X-rays of several nanostructures made of disparate combinations of conductors (Al, Cu, Ta, ITO) and oxides (SiO, TaO, AlO). We measured current-voltage curves in parallel-plate configuration separated by an air gap and determined three characteristic parameters: current at zero voltage bias I, the voltage offset for zero current ECPD, and saturation current I. We found that the metals' ECPD values measured with our technique were higher than the CPD values measured with photoelectron spectroscopy in situ, i.e., no air contact. These differences are related to natural oxidization and to the presence of photo-/Auger-electron current leaking from the high-Z toward the low-Z electrode, as suggested by additional experiments carried out in vacuum. Further, the deposition of the 40-500 nm oxide layer on the surface of metallic substrates strongly affects their contact potential. This technique exploits ionization and charge carrier transport in both solid insulators and in air, and it opens the possibility of measuring the ECPD between metals separated by a solid insulator in a metal-insulator-metal (MIM) configuration. Additionally, we demonstrated that certain configurations of MIM structures are suitable for X-ray detection in self-powered mode.