Whole-cell biopanning with a synthetic phage display library of nanobodies enabled the recovery of follicle-stimulating hormone receptor inhibitors.