Boston is looking to restrict the number of nights a short-term housing rental can be offered through a service like Airbnb.

Mayor Marty Walsh filed a proposed ordinance Monday to track and regulate the rentals of residences for varying periods of time.

"This ordinance is an important step towards our goal of reducing housing costs by creating disincentives to taking units off the market for use as short-term rentals," Walsh said in a statement.

The measure would split short-term rentals into three tiers:

If someone rents out a room or space in their residence, it would be classified as a "limited share unit." If someone rents out their entire primary residence, it would be classified as a "home share unit." And a non-owner, non-tenant unit that's rented out would be classified as an "investor unit."

The number of nights "home share" and "investor" units could be rented out would be capped at 90 days per year. There would be no limit for "limited share" units.

All units would be required to be registered with the city. And there would be annual fees of $25, $100 and $500, depending on the classification.

The ordinance would also prohibit the listing of residences with any outstanding code violations (building, sanitary, zoning, fire, etc.). The measure would set up a complaint process to report violations, and there would be fines for any violations. The city's Inspectional Services Department would oversee short-term rentals.

Airbnb said it's reviewing the mayor's proposal and looks forward to having some regulation on the books. According to the company, more than 3,000 Boston families rented out their residences using Airbnb last year.

"We are pleased that the city of Boston is making progress on regulations for our home sharing community, and will continue our review of the full proposal," Airbnb spokeswoman Crystal Davis said in a statement.

Paul Sacco, the head of the Massachusetts Lodging Association, called the proposed regulations a good first step in leveling the playing field between hotels and private short-term rentals.

"This [ordinance] will really do the basics of that, but it really doesn't get towards regulating to the degree that we’re regulated," Sacco said. "But we’ve never really asked for that. We have just simply said they need to be regulated as it relates to health regulations, fire regulations, etc."

The proposed ordinance aims to strike a balance between allowing the home-share industry to continue growing in Boston, while preventing people from monopolizing the city's housing market.

Housing affordability is a major concern for many residents. In its announcement of the proposed ordinance, the mayor's office cited a 2016 UMass Boston study that found a correlation between short-term rental units and a slight increase (0.4 percent) in rental prices. Walsh has a goal of adding 53,000 housing units by 2030.

There is also a need for more hotel rooms in the city.

"I think the use of short-term rentals and what we see as how many exist in the city is an indicator that we may not have as many hotel rooms as we may like," Chris English, a city policy analyst who's been leading its work on short-term rentals, said in a phone interview.

English said the ordinance would allow the city to get a clearer sense of the home-share market in Boston.

"We want to create a structure for short-term rentals that are currently operating in the city of Boston so we have better tools to monitor and measure the use across the city,"English said.

He said right now the city relies on gathering data from scanning listings online. Overall there where 5,000 to 6,000 listings -- with two-thirds of those for entire units — between January and October last year, English said.

Under the proposed ordinance, short-term rental companies would be required to share data and listing information with the city each month.

The city ordinance comes as state lawmakers continue to debate legislation regulating short term housing rentals.

The mayor's proposed ordinance requires approval by the city council.