As K-edge X-ray absorption near edge structure (XANES) for NaFeAs and LiFeAs has been examined at very high pressures up to 240 GPa through first principles studies. At higher pressures as well as at higher photon energies both the compounds exhibit larger number of prominent spectral features in absorption spectra. Electronic origin of non-identical spectroscopic features corresponding to different local structural environment is described thoroughly using the unoccupied atom projected partial density of states. Overall we find that the near edge features are dominated by 1s→p type electronic transitions. Using Bader charge integration algorithm interrelation between the absorption edge energy with the interlayer charge transfer has been established, where we find that larger inter-layer charge transfer shifts the absorption edge to lower photon energies. In case of NaFeAs, the interlayer charge transfer (∼0.78e) is maximum at ambient pressure, while the corresponding absorption edge is minimum. For LiFeAs, the interlayer charge transfer (∼0.49e) is minimum at 60 GPa pressure (where it becomes a semiconductor), while the absorption edge is maximum. In absence of high pressure experimental data, we have also shown that at ambient pressure our theoretical XANES spectra agree well with the available experimental data. Core-hole effect is found to have substantial effects on the absorption spectra at higher pressures.