Sitting in bed at 1:40 a.m. one morning last November, Jon Hoefling was thinking about selling his 4,300-square-foot home in Morgan Hill, Calif. While browsing Facebook on his phone, he clicked on a real-estate ad offering to estimate his home’s value. His future listing agent, who paid for the ad, was waiting.

Mr. Hoefling, the 50-year-old owner of an office-furniture resale company, had been targeted for the ad—along with 1,500 others in California’s Silicon Valley area—by an algorithm that identified him as a likely home seller. The telltale signs: Mr. Hoefling has lived in the home for more than 15 years, and his home’s market value is high for the area. Most important, his youngest son will soon leave for college. Empty nesters might as well wear a bull’s-eye.

To target prospective clients in competitive markets, tech-savvy agents are buying data subscriptions and teaming up with firms that identify potential buyers using increasingly precise metrics. Exotic-car owners can be courted to buy a car-collector’s mansion. Equestrians are rounded up for ranch homes

Last year, Sotheby’s International Realty announced a partnership with Wealth-X, a consulting group that uses public records and research staff to manually track the habits of “ultrahigh-net-worth individuals.” There are about 211,000 people world-wide valued at more than $30 million, according to the company’s president and co-founder, David Friedman—and the firm’s goal is to write a detailed dossier on each one of them.

These reports may contain everything from an individual’s net worth and social circles to even more personal details. For example, the dossier for one Australian multimillionaire notes that he is likely fond of topiary, because he proposed to his wife in front of a massive topiary created by artist Jeff Koons.