By Constance Brinkley-Badgett/Credit.com

If you're looking to buy or sell a home this year, you probably know the housing market is booming in virtually every corner of the country. In fact, homeowners who sold in the first quarter of the year realized an average price gain of $44,000 since purchasing their home, a new ATTOM Data Solutions report shows. That equals an average 24 percent return on purchase price across the country — the highest average price gain for home sellers in nearly 10 years.

"The first quarter of 2017 was the most profitable time to be a home seller in nearly a decade, and yet homeowners are continuing to stay put in their homes longer before selling," said Daren Blomquist, senior vice president with ATTOM Data Solutions. The report showed homeowners are staying in their homes just shy of eight years on average. "This counter-intuitive combination is in part the result of the low inventory of move-up homes available for current homeowners, while also perpetuating the scarcity of starter homes available for first-time homebuyers," Blomquist added.

Of course, there are still some laggards. Baton Rouge, Louisiana, for example, saw average home prices decline by $15,000 from their previous purchase price. The same is true for Huntsville, Alabama, where average home prices declined by $8,100.

Get Breaking News Delivered to Your Inbox

Of the 20 metro areas with the highest percent return on the previous purchase price, 10 were located in California and three were in Colorado. Competition among homebuyers, especially in these areas, is fierce, so it's particularly important to have your finances locked and loaded before you start your search. Regardless of where you're looking, getting pre-approved for a mortgage is key. You'll also want to be sure your credit is in good shape so you'll get the best mortgage terms available. You can check your credit scores for free on Credit.com.

These are the top 20 metro areas where home sellers are making the most money when selling their homes.

20. Port St. Lucie, Florida

Average return on investment: 39%

Average price gain: $53,000

19. Austin-Round Rock, Texas

Average return on investment: 39%

Average price gain: $81,795

18. San Diego-Carlsbad, California

Average return on investment: 41%

Average price gain: $144,000

17. Riverside-San Bernardino-Ontario, California

Average return on investment: 41%

Average price gain: $90,000

16. Boston-Cambridge-Newton, Massachusetts-New Hampshire

Average return on investment: 41%

Average price gain: $111,100

15. Oxnard-Thousand Oaks-Ventura, California

Average return on investment: 43%

Average price gain: $160,000

14. Sacramento-Roseville-Arden-Arcade, California

Average return on investment: 43%

Average price gain: $99,000

13. Fort Collins, Colorado

Average return on investment: 43%

Average price gain: $97,500

12. Greeley, Colorado

Average return on investment: 44%

Average price gain: $85,050

11. Urban Honolulu, Hawaii

Average return on investment: 46%

Average price gain: $161,110

10. Salem, Oregon

Average return on investment: 46%

Average price gain: $70,800

9. Vallejo-Fairfield, California

Average return on investment: 47%

Average price gain: $115,000

8. Denver-Aurora-Lakewood, Colorado

Average return on investment: 50%

Average price gain: $110,000

7. Los Angeles-Long Beach-Anaheim, California

Average return on investment: 50%

Average price gain: $187,000

6. Stockton-Lodi, California

Average return on investment: 51%

Average price gain: $101,000

5. Modesto, California

Average return on investment: 51%

Average price gain: $87,500

4. Portland-Vancouver-Hillsboro, Oregon-Washington

Average return on investment: 52%

Average price gain: $110,799

3. Seattle-Tacoma-Bellevue, Washington

Average return on investment: 56%

Average price gain: $139,325

2. San Francisco-Oakland-Hayward, California

Average return on investment: 65%

Average price gain: $276,750

1. San Jose-Sunnyvale-Santa Clara, California

Average return on investment: 71%

Average price gain: $356,000