The S&P 500 has been on a tear since the start of 2023. Posting a 32.2% total return and hitting an all-time high earlier this year, the index is going through one of its best bull runs ever.

However, audio streamer Spotify (SPOT 0.20%) has managed to crush the returns of the broad market over that period. Its shares are up 205% since the start of 2023, making it one of the best-performing stocks in the world over that time frame.

With expanding margins and consistent revenue growth, Spotify has proven a lot of the naysayers wrong, and it looks to be on a path of continued growth this year and beyond. Does that make the stock a buy today? Let's take a deeper look at the numbers and find out.

SPOT Total Return Level Chart

Data by YCharts.

A music business firing on all cylinders

Spotify has a two-pronged strategy to grow its music subscription business: Expand globally and raise prices in wealthier markets. It now operates in virtually every country around the globe. With smartphone penetration and internet speeds still growing, the leading music-streaming company has a long tailwind to expand its user base.

Last quarter, Spotify's premium subscribers grew 15% year over year to 236 million, which is up from less than 100 million at the end of 2018. On top of this subscriber growth, Spotify has started to raise prices in markets such as North America and Western Europe. Importantly, the company has been able to do this with minimal impact on churn, indicating the service still has plenty of pricing power.

Add it all together, and premium subscription revenue grew 21% year over year on a foreign currency-neutral basis, hitting an annual run rate of $13.7 billion. With plenty of years left in the transition from legacy analog music listening (radio) to digital services, such as Spotify, the company should be able to keep up this strong revenue growth for the rest of this decade.

Can they fix the podcasting and advertising segment?

The music segment is crushing it, but Spotify is still struggling with the business investors were extremely bullish on back in 2020 and 2021: podcasts. Sure, Spotify has now taken the market share lead over the legacy leader, Apple Podcasts, but it took billions of dollars in investments to get there.

In order to turn a profit in this industry, Spotify plans on growing the size of its digital audio advertising business. It hasn't had any issues finding podcasts to use its advertising services -- the company owns the leading distribution platforms in Anchor and Megaphone -- but it has struggled to convince advertisers to start spending money with them.

You can see this quantitatively in the company's ad-supported revenue, which only grew 17% year over year last quarter to $540 million. This was slower growth than the premium segment despite it being much smaller. Spotify's investments in podcast content (for example, the recent $250 million deal for the Joe Rogan Experience) have affected its margins. Ad-supported gross margins were just 11.6% in the fourth quarter, making the segment a drag on Spotify's overall profitability.

In order for Spotify to have success in podcasting, it needs to grow its advertising business much larger. Investors should be closely tracking advertising revenue growth as a key performance indicator over the next few years.

Is the stock a buy today?

Over the last 12 months, Spotify has generated $13.6 billion in revenue and is growing 20% year over year on a consolidated basis. Consolidated margins have also started to climb higher with the fourth quarter's operating margin hitting negative 2.0% compared to negative 7.3% a year ago. After laying off 17% of its employees at the end of 2023, margins should continue to move higher this year toward Spotify's long-term goal of 10%.

The problem is that Spotify now boasts a market cap of $47 billion. Even taking into account the positive earnings outlook, the stock trades at a forward price-to-earnings ratio (P/E) of 59. Spotify will need to deliver both strong revenue growth and margin expansion for multiple years before its valuation comes closer to broad market levels.

Can the company deliver? Perhaps. But the stock doesn't look like a great buy at today's prices due to investors' high expectations.