A data broker sells market segmentations created by consumer data to a producer with private production cost who sells a product to a unit mass of consumers with heterogeneous values. In this setting, I completely characterize the revenue-maximizing mechanisms for the data broker. In particular, every optimal mechanism induces quasi-perfect price discrimination. That is, the data broker sells the producer a market segmentation described by a cost-dependent cutoff, such that all the consumers with values above the cutoff end up buying and paying their values while the rest of consumers do not buy. The characterization of optimal mechanisms leads to additional economically relevant implications. I show that the induced market outcomes remain unchanged even if the data broker becomes more active in the product market by gaining the ability to contract on prices; or by becoming an exclusive retailer, who purchases both the product and the exclusive right to sell the product from the producer, and then sells to the consumers directly. Moreover, vertical integration between the data broker and the producer increases total surplus while leaving the consumer surplus unchanged, since consumer surplus is zero under any optimal mechanism for the data broker.