BOISE, Idaho — Based on a study of 300 U.S. cities and using 23 metrics, Boise was ranked the healthiest housing market for buyers interested in midsize cities, according to WalletHub. 

A midsize city, defined by WalletHub, is 150,000 to 300,000 residents. 

This ranking may come as a shock considering, housing prices in the Treasure Valley are rapidly rising, the low inventory of homes has grown into a crisis and Ada and Canyon County wages are far too low to afford the cost of renting. 

"Close to half of renters in Boise are considered 'cost-burdened,' spending more than 30% of their income on housing," officials at the National League of Cities study said.

RELATED: ‘Just barely making it’: Boise residents struggle to stay afloat amid rising rents and plunging vacancy rates

So what exactly does this ranking mean? It means even with all those problems, WalletHub says Boise is still the best place to purchase a house in the United States. 

When multiple factors are taken into account like appreciation, 'underwater' homes, foreclosure rate, homes that sell for a gain, population growth rate, maintenance affordability, job growth rate, and unemployment, Boise is still one of the healthiest housing markets in the U.S. 

RELATED: Wall Street Journal notes 'red hot' Boise housing market

Newark, NJ was ranked as the worst real-estate market, followed by Detroit, MI and Miami Beach, FL.  

Five of the top ten least affordable cities that included an unhealthy economic environment were in California. 

See rankings below: (1 being the least affordable)

  1. Detroit, MI
  2. Newark, NJ
  3. Flint, MI
  4. Hartford, CT
  5. Inglewood, CA
  6. El Monte, CA
  7. Salinas, CA
  8. Santa Barbara, CA
  9. Oakland, CA
  10. Buffalo, NY

RELATED: Report: Boise ZIP code among the 'hottest' in the nation when it comes to home sales

Watch more 'Growing Idaho': 

See them all in our YouTube playlist: