Only 25% of bacterial membrane transporters have functional annotation owing to the difficulty of experimental study and of accurate prediction of their function. Here we report a sequence-independent method for high-throughput mining of novel transporters. The method is based on ligand-responsive biosensor systems that enable selective growth of cells only if they encode a ligand-specific importer. We developed such a synthetic selection system for thiamine pyrophosphate and mined soil and gut metagenomes for thiamine-uptake functions. We identified several members of a novel class of thiamine transporters, PnuT, which is widely distributed across multiple bacterial phyla. We demonstrate that with modular replacement of the biosensor, we could expand our method to xanthine and identify xanthine permeases from gut and soil metagenomes. Our results demonstrate how synthetic-biology approaches can effectively be deployed to functionally mine metagenomes and elucidate sequence–function relationships of small-molecule transport systems in bacteria.