Abstract We show that the photoassociation (PA) rate of ultracold diatomic molecules in the vicinity of a Feshbach resonance could be used to probe variations of the electron-to-proton mass ratio β=me/mp, a quantity related to other fundamental constants via the ΛQCD scale. The PA rate exhibits two features near a Feshbach resonance, a minimum and a maximum, which are very sensitive to the details of the interactions and the exact mass of the system. The effect and detection threshold are illustrated in the formation rates of ultracold Li2 and LiNa molecules by performing coupled-channel calculations in an external magnetic field. We find that the PA rate is particularly sensitive near narrow Feshbach resonances in heavy molecules, where it might be possible to detect relative variability of β on the order of 10-15–10-16. We also use a two-channel model to derive a proportionality relation between the variation of the PA rate and β applicable to diatomic molecules.