What happened

Shares of CoStar Group (CSGP 0.48%) popped as much as 15.7% this week, according to data from S&P Global Market Intelligence. The company, which operates real estate platforms CoStar, Apartments.com, and LoopNet, posted solid earnings results for the second quarter. After the market close on Thursday, the stock is up 14.7% this week.

So what

CoStar released its second-quarter earnings report on July 26. Revenue grew 12% year over year to $536 million, slightly beating analyst expectations. Non-GAAP (adjusted) earnings per share (EPS) hit $0.28, beating consensus analyst estimates by 33%. This earnings beat is likely why CoStar's stock rose so much in the days following the results.

Looking deeper into the results, CoStar is seeing strong growth from both Apartments.com and LoopNet. Net new bookings at Apartments.com grew 130% year over year, showing how strong the rental market is right now. LoopNet, which is a commercial property real estate platform, grew bookings 40% year over year as the market continued to recover from the pandemic work-from-home trend. 

Because of these results and trends within its business, CoStar raised its full-year guidance by $13 million to a range of $2.165 billion to $2.18 billion. While it was only a slight change, investors were likely optimistic about this news.

Lastly, CoStar benefited from a rise in the broad market this week. As of this writing, the S&P 500 has been up almost 2% in the last five trading days, showing optimism among investors this earnings season.

Now what

Right now, CoStar has a market cap of $28 billion. Over the last 12 months, it has generated $1.6 billion in gross profit and $445 million in free cash flow. This puts the stock at a price-to-gross-profit (P/GP) ratio of 17.5 and a price-to-free-cash-flow (P/FCF) ratio of 63. Both are much higher than the market average, giving CoStar a premium valuation at the moment.

What does this mean? If you plan on buying shares of CoStar Group, you need to be confident that both revenue and cash flow will grow at a high rate for many years. At current prices, forward returns for shareholders will be poor if this doesn't happen.