Restoring ammonia from waste nitrate stands as a promising strategy for reducing reliance on the energy-intensive Haber-Bosch process and tackling environmental pollutants. Advancing the catalytic aspects of photoelectrochemical (PEC) ammonia synthesis via waste nitrate reduction is of great importance to enhance its viability for sustainable chemical production. However, this process still suffers from low ammonia faradaic efficiency (FE) with high operational potential due to its involvement in multi-electron reactions. Herein, we integrated a cobalt-doped TiOx (Co-TiOx) cocatalyst and Ag nanowires (NWs) electron extraction layer onto TiOx/CdS/Cu2ZnSnS4 (CZTS) photocathode, achieving nearly 100 % ammonia FE and an onset potential of ∼0.49 V vs. RHE. Evidenced by the in-situ synchrotron-radiated FTIR (SR-FTIR) and theoretical calculations, the increased ratio of surface oxygen vacancy sites (Vo) induced by Co-TiOx is crucial for the key reaction intermediates adsorption (i.e. *NO3 and *NO2) for subsequent ammonia production. Moreover, the transparent Ag NWs facilitates the electron extraction from TiOx/CdS/CZTS to the surface catalytic sites. Powered by CZTS solar cells, a standalone solar-to-ammonia system has been demonstrated with outstanding activity and catalytic performance.