Here is just how fast homes are selling in the Boston metro area

Homes in the United States sold in 2017 at their fastest pace on record, according to a new Zillow study based on the site’s home listing data. It took 81 days to sell the median-valued U.S. home last year, which was nine days faster than in 2016.

Boston real estate sold even faster.

On average, homes in the Boston metro area took 72 days to sell in 2017, from the time of listing to closing. Zillow analyzed the 35 biggest housing markets in the country and found that Boston fell right in the middle at No. 18 on the list.

“As demand has outpaced supply in the housing market over the past three years, buying a home has become an exercise in speed and agility,” said Aaron Terrazas, a senior economist at the site, in a statement. “This is shaping up to be another competitive home shopping season for buyers, who may have to linger on the market until they find the right home but then sprint across the finish line once they do.”

Nationally, Zillow found that homes sold faster in 2017 than they did in 2016 in 33 of the 35 markets included on the report. Houston and Miami were the two exceptions.

In Houston, homes sold in 80 days in 2016 and 81 days in 2017. Zillow noted that Hurricane Harvey and subsequent flooding could have impacted the city’s housing market. In Miami, homes sold in 110 days during both years. Hurricanes could have also influenced the Florida housing market, according to Zillow.

The report indicates the fastest-selling market last year was San Jose, where the median-valued home sold in just 41 days, while the slowest-selling market was the New York/Northern New Jersey metro area, where homes were on Zillow for an average of 134 days before selling.

Across the country, the housing inventory has fallen on a year-over-year basis for the past 37 months, according to Zillow’s data. Boston is not immune to this trend; inventory in the metro area is down 10.9 percent over the last year.

This low inventory also helps to contribute to a higher selling price. In the Boston metro area, 40.6 percent of homes sold for more than the asking price last year. Nationally, nearly a quarter of all homes sold above their asking price in 2017.

“Being prepared — working with a great agent, getting financing preapproved — can help a buyer make a stand-out offer,” Terrazas said.