Nonlinear optics (NLO) and its applications have attracted increasing research interest in recent years owing to their contribution to the development of photonic technology. Accordingly, in this study, we investigated the NLO response of pumpkin seed oil using the spatial self-phase modulation (SSPM) method. Significant NLO characteristics have been experimentally studied at
and
continuous wave (CW) laser wavelengths, yielding second-order nonlinear refractive index (
) values of
and
, respectively. The findings suggest that the absorption of the material leads to higher optical nonlinearity at shorter wavelengths owing to higher thermal effects. Furthermore, we implemented a light-controlled-light system based on the spatial cross-phase modulation (SXPM) technique employing pumpkin seed oil. We successfully achieved all-optical switching by designing the 'ON' and 'OFF' modes. The results of this study can be considered for the future development of NLO applications. Moreover, our work investigates the potential of pumpkin seed oil for designing low-cost and high-efficiency NLO devices, and this contribution opens up a novel practical avenue for oil-based optical devices.