Even the first step into the real estate market for many buyers — condominiums — is getting harder to reach in the Bay Area.

Buyers stretching their budgets and looking for deals have driven condo prices up and inventory down to near-record lows, mirroring the trend in single family homes.

The median sale price for a condo unit in Santa Clara and San Mateo counties last month was $810,000, up 20 percent from the same time last year, according to real estate marketing firm Polaris Pacific. Median sale prices for units in Oakland and Emeryville climbed 4.5 percent, to $575,000. And San Francisco gained 2.7 percent, with a median price of $1.17 million.

The combination of high-income tech jobs and limited housing choices has driven the condo market, said Paul Zeger, founder of Polaris Pacific. The once-held family dream of a four-bedroom, two-bath house on a large lot has given way to a more affordable plan — a modern condominium in a good school district, he said.

“Affordability is a huge factor,” Zeger said, adding that new buyers “have to be realistic.”

Sales of existing single-family homes in the Bay Area have been rising every month for the last six years, according to real estate data firm CoreLogic. The median price for homes sold in March in the nine-county region was $850,000. The median home price for a single family home was $1.36 million in Santa Clara County, $1.56 million in San Mateo County, $860,000 in Alameda County and $610,000 in Contra Costa County.

The hottest cities in the Silicon Valley condo market were Santa Clara, Sunnyvale, Campbell and Cupertino, where prices rose 30 percent in the last year. Only about 380 new condos are on the market in San Mateo and Santa Clara counties, a drop of 40 percent from the previous year, according to Polaris Pacific.

Tony Ngai, an agent with Maxreal Cupertino, said condominiums are still a good entry point into the real estate market for younger buyers. “For millennials, that’s pretty much all they can afford,” he said.

A typical buyer might be a single, tech engineer looking for a place in a city, away from their jobs in Silicon Valley, he said. Even if the owner moves, Ngai said, the condo remains a good investment. “It’s easy for them to rent out,” he said.

Will Doerlich, agent with Realty One in San Ramon, said with rising single family home prices “a number of clients are looking at condos as an alternative.”

One of Doerlich’s clients in Walnut Creek chose to buy a condo in Emeryville as an investment, renting out the one-bedroom instead of moving in. The client still rents a home in Walnut Creek but found the investment property was a good way to gain equity.

The demand has driven a condo-building spree in some Bay Area cities. About 3,000 new units have been approved in the South Bay, with about one-third planned for San Jose. Campbell, Santa Clara and Cupertino also have approved substantial construction projects.

San Francisco has 1,760 units under construction and another 7,400 approved, while Oakland has 265 being built and has green-lighted an additional 1,060 condos.

On the other end of the spectrum, Palo Alto, Los Altos, Mountain View and Menlo Park have no units under construction, according to Polaris Pacific. Those cities also are the most desirable to buyers: The median sale price for a unit in those cities was $1.3 million, with a top price reported at about $2.5 million.

Developers are responding to consumer demand and financing costs and building more condos than apartments in the Bay Area, Zeger said. Low interest rates also have enticed buyers into the market.