Axion-gluon interaction induces quadratic couplings between the axion and the matter fields. We find that, if the axion is an ultralight dark matter field, it induces small oscillations of the mass of the hadrons as well as other nuclear quantities. As a result, atomic energy levels oscillate. We use currently available atomic spectroscopy data to constrain such axion-gluon coupling. We also project the sensitivities of future experiments, such as ones using molecular and nuclear clock transitions. We show that current and near-future experiments constrain a finely-tuned parameter space of axion models. These can compete with or dominate the already-existing constraints from oscillating neutron electric dipole moment and supernova bound, in addition to those expected from near future magnetometer-based experiments. We also briefly discuss the reach of accelerometers and interferometers. Comment: 7 pages, 1 figure