SPICAM-IR, an AOTF spectrometer onboard Mars Express spacecraft with a resolving power of 2,000 covering the spectral range 1-1.7 μm has been observing Mars since 2004. In this wavelength range, it is possible to distinguish between CO2 and H2O ices and measure their band depths. We obtained about 200,000 high-fidelity spectra of CO2 ice in different seasons and locations over the Martian polar caps. The spectra have been associated with slab ice, fine-grained ice, permanent caps, and dark and dirty ice at the cryptic region of the south polar cap. Also, we observed more than 200,000 water ice spectra, specifically its broad feature around 1.5 μm. Water ice is present at the surface or in the atmosphere resulting in a variety of different band depths, often in combination with the CO2 ice. We mapped the equivalent width of 1.43 μm CO2 ice band and the depth of 1.5 μm water ice band, which are the proxies for grain size, and followed their seasonal evolution. From the maps, we produced the edge (outer crocus line) of the CO2 south and north caps for nine Martian Years. The cap edges evolve similarly through all years and are in good agreement with previous OMEGA/Mars Express observations. We also discuss the impact of the global dust storms on the cap edges. Lastly, we interpret some of the water ice observations as water ice clouds in the aphelion cloud belt and the polar hoods.