The stock market has been recovering slowly but steadily in 2023 after last year's battering. This is evident from the 7% gains that the S&P 500 has logged so far this year despite facing multiple headwinds -- such as the banking crisis in the U.S., the debt ceiling, and the potential for a recession.

However, this year's stock market recovery is not without reason. Cooling inflation, the Federal Reserve's decision to slow the pace of rate hikes, and hot trends such as artificial intelligence (AI) seem to have encouraged investors to park their funds in stocks once again. And that seems to be the right thing to do, as the stock market has historically averaged robust returns despite periods of volatility.

So if you have $1,000 to spare right now, which means that your bills are paid, you have enough savings for a rainy day, and there is no high-interest loan to service (such as credit card debt), it may be a good time to use that money to buy some top companies that could deliver healthy returns in the long run.

In this article, we will look at a couple of names that you might want to consider buying with $1,000 of your investable cash, either individually or combined.

This tech giant is built for long-term growth

Apple (AAPL 1.28%) is the world's most valuable company by market capitalization, and that's not surprising given how it has been navigating a challenging smartphone market. The tech giant's revenue for the second quarter of fiscal 2023 (for the three months ended April 1, 2023) came in at $95 billion, down just 3% from the prior-year period despite its significant reliance on the smartphone market.

That's because Apple's smartphone shipments fell just 2.3% year over year in the first quarter of 2023, which was a much smaller decline compared to the 14.6% decline in overall smartphone shipments. As a result, Apple now controls 20.5% of the smartphone industry's shipments, second only to Samsung, which holds a 22.5% market share.

However, Apple's terrific smartphone pricing power explains why the company has been able to corner nearly half of the industry's revenue and 85% of the profits. The iPhone commands an average selling price (ASP) of almost $1,000, and the figure has been increasing at a time when the industry is under duress.

This bodes well for Apple's future, as the smartphone market's revenue is expected to head significantly higher by the end of the decade. Spherical Insights estimates that the global smartphone market could generate $947 billion in annual revenue by 2030, compared to $520 billion in 2021. If Apple manages to corner half of that massive revenue opportunity, its iPhone revenue could jump to nearly $475 billion a year. That would be more than double the company's fiscal 2022 iPhone revenue of $205.5 billion.

It wouldn't be surprising to see Apple hit that mark considering that it is expanding in lucrative markets such as India and is reportedly looking to enter new smartphone niches such as foldable devices, both of which could substantially boost its revenue in the long run. Throw in the fact that Apple is recording consistent growth in the highly profitable services business, and it is easy to see why the company could be a long-term winner.

Apple has turned a $1,000 investment into more than $3,800 in the past three years (assuming the dividends were reinvested), and it could replicate this terrific performance in the future as well.

Programmatic advertising's growth could help this stock fly higher

The Trade Desk (TTD 2.96%) is another high-flying stock that has turned a $1,000 investment into just over $8,000 in the past five years. The company has won big from the growing adoption of programmatic advertising, which allows brands and advertisers to automate their ad buying and campaign management. For instance, programmatic ad spending in the U.S. nearly doubled to $95 billion last year from $49 billion in 2018.

The Trade Desk has benefited substantially from the market's growth.

TTD Revenue (TTM) Chart

TTD Revenue (TTM) data by YCharts

The programmatic advertising market still has a lot of room for growth. This space is expected to clock annual growth of 32% over the next five years and generate a whopping $2.7 trillion in revenue. That's not surprising, as The Trade Desk predicts all advertising media will eventually become programmatic and will be transacted digitally.

This explains why the company sees the total global advertising spending of $830 billion as its addressable market. More importantly, The Trade Desk's programmatic platform has allowed it to outgrow the digital ad market significantly. That trend is likely to continue, as the company's use of AI to help advertisers and brands improve their returns on advertising spend is likely to help it attract more users.

In all, considering the huge market opportunity that The Trade Desk is sitting on, it could continue to grow at a terrific pace in the long run. Its trailing 12-month revenue stands at just $1.65 billion, compared to the massive addressable market on offer, which tells us why analysts are expecting an acceleration in the company's growth.

TTD Revenue Estimates for Current Fiscal Year Chart

TTD Revenue Estimates for Current Fiscal Year data by YCharts

Of course, investors will have to pay a premium if they want to buy this growth stock. The Trade Desk is trading at an expensive 20 times sales following its terrific gains of 47% so far in 2023. But it is still available at a discount to its five-year average price-to-sales ratio of 26. The company's prospects indicate that it could sustain its impressive growth in the long run, which is why it may be a good idea for growth-oriented investors to put their money in The Trade Desk.