Résumé : Aims. Neutron star (NS) mergers are thought to be a source of heavy trans-iron element production. The latter can be detected in the spectra of the ejected materials, from which bright electromagnetic radiation is emitted. This latter is due to the radioactive decay of the produced heavy r-process nuclei and is known as kilonova. Because of their complex atomic structures "characterized by configurations involving unfilled nd or nf subshells "the heavy elements of the kilonova ejecta often give rise to numerous absorption lines generating significant opacities. The determination of the latter, which are of paramount importance for the analysis of kilonova light curves, requires knowledge of the radiative parameters of the spectral lines belonging to the ions expected to be present in the kilonova ejecta. The aim of the present work is to provide new atomic opacity data for two representative 4d elements, niobium (Nb) and silver (Ag), in their first four charge states, namely for Nb I-IV and Ag I-IV. Methods. Large-scale calculations based on the pseudo-relativistic Hartree-Fock (HFR) method were performed to obtain the atomic structure and radiative parameters while the expansion formalism was used to estimate the opacities. Results. Wavelengths and oscillator strengths were computed for several million spectral lines in Nb I-IV and Ag I-IV ions. The reliability of these parameters was estimated by comparison with the few previously published experimental and theoretical results. The newly obtained atomic data were then used to calculate expansion opacities for typical kilonova conditions expected one day after NS merger, a density of ρ = 10-13 g cm-3, and temperatures ranging from T = 5000 K to T =15 000 K.