SAN JOSE (CBS SF) – The number of homes affordable to median income people in San Jose dropped drastically in 2018, according to a new analysis this week.

In a study released by Redfin, the real estate website calculated the share of homes that were affordable to those earning the median income in 49 metro areas across the country.

Redfin found that in 2018, only 14 percent of homes for sale in the San Jose market were “affordable” to residents making the area’s median household income of $117,000, the lowest in the country. By comparison, 26 percent of homes were affordable to median income earners in 2017.

The 54 percent drop in affordable homes in San Jose comes as the total number of homes for sale in the market dropped by 15.6 percent.

“Prices have being going up for a number of years now and it’s made the lower priced homes more attractive,” said local real estate agent Gary Shapiro. “So more and more lower priced homes are selling and it’s leaving higher and higher priced properties on the market.”

Erik Devaney and his wife moved to California from the east coast three years ago. Renters like them had enough saved to buy a home, but never thought they’d buy in Silicon Valley.

“I personally had no interest in buying in the Bay Area,” said Devaney. However, when their landlord recently asked them if they wanted to buy their rental home, the Devaneys decided to seize the opportunity. They know they are some of the lucky ones.

“Everything just kind of clicked and we decided to go for it,” said Devaney. “We decided, hey, if we’re going to buy something, we better do it now because, love it or hate it, these tech companies are going to keep coming and keep moving in.”

“It’s going to be harder in the future for people to afford houses in the South Bay if they’re not tied into the tech industry, which tends to pay the highest salaries,” said Shapiro. The home Devaney is buying is 1,100 square feet and just under $1 million.

He said he may be buying a home in the least affordable city in the United States, but he’s not sold on staying in San Jose because he knows his money can get him much more somewhere else.

“This house in any other city would be significantly less,” said Devaney. “We’re paying for the location more than anything.”

• ALSO READ: 9 Astonishing Numbers On The Bay Area Housing Crisis In 2018

In the San Francisco market, 26 percent of homes in the market were affordable to median income earners last year, down from 31 percent in 2017. The total number of homes for sale in San Francisco actually inched up slightly in 2018.

Nationwide, researchers found while inventory is increasing, there were fewer homes affordable to the middle class in much of the country. In San Diego, for example, there were 16 percent fewer affordable homes for sale last year, despite an increase of sales by 10 percent.

The real estate website pointed to gains in home prices, along with interest rate increases as reasons why there are fewer affordable homes available.

• ALSO READ: 2 Cats Live By Themselves In $1500/Mo. Silicon Valley Studio

“Homeownership is increasingly out of reach for the typical American,” Redfin chief economist Daryl Fairweather said in a statement. “Over the last few years builders have focused on luxury homes, and there hasn’t been enough construction of affordable starter homes.”

St. Louis, Missouri had the highest percentage of affordable homes for median income earners in the country, at 84 percent.

The analysis assumes a 20 percent down payment and a monthly mortgage payment of no more than 30 percent of gross income.

A report by Zillow last year found it would take the median income household in San Jose a staggering 22 years to save up for a 20 percent down payment, if they saved 10 percent of their income every month.

Tim Fang is a digital producer for CBS San Francisco and a native of the Bay Area. Follow him on Twitter @fangtj.