NEW YORK — The New York City Council voted unanimously Wednesday to significantly restrict Airbnb and other online home rental services, joining a growing movement of cities around the globe in stepping up regulation of the so-called sharing economy.

The bill aims to prevent landlords and tenants from illegally renting out apartments for a few days at a time to tourists, a phenomenon that the city says has aggravated the housing crisis by making short-term rentals more profitable than long-term leases.

Online rental services like Airbnb and HomeAway would be required to provide the addresses and names of hosts to the city’s Office of Special Enforcement every month and to note whether rentals are for a whole apartment or just a room.

If the bill is signed into law, New York will join cities like San Francisco; New Orleans; Barcelona, Spain; and Vancouver, British Columbia, in regulating companies that profit from facilitating short-term rentals.

New York City is Airbnb’s largest domestic market, but under state law, it is illegal in most buildings for an apartment to be rented out for less than 30 days unless the permanent tenant is residing in the apartment at the same time. The new disclosure requirements would make it much easier for the city to enforce the state law and could lead to many of the 50,000 units rented through Airbnb in the city coming off the market. After similar rules went into effect in San Francisco, listings fell by half.

“The vacancy rate in New York City is very low,” Council Speaker Corey Johnson said before the vote. “We’re in an affordable housing crisis. We’re in a homelessness crisis. And Airbnb will not give us this data.”

A City Hall spokeswoman said the new restrictions had the support of Mayor Bill de Blasio, who has made affordable housing one of his priorities, and he is expected to sign the bill into law.

Companies will face fines of up to $1,500 for each listing they fail to disclose, down from the $25,000 originally proposed.

Airbnb opposed the bill, arguing that it would hurt everyday New Yorkers who were renting spare rooms in their apartments to make ends meet. Throughout the debate over the bill, the company accused City Council members of kowtowing to the hotel industry. Last month Airbnb published a list of City Council members and how much the hotel industry had contributed to each of their campaigns.

“After taking hundreds of thousands of dollars in campaign contributions from the hotel industry, we’re not surprised the City Council refused to meet with their own constituents who rely on home sharing to pay the bills and then voted to protect the profits of big hotels,” Liz DeBold Fusco, a spokeswoman for Airbnb, said in a statement, adding that the bill would violate the privacy of the sites’ users and subject them to “unchecked, aggressive harassment.”

The question of what would be best for “ordinary New Yorkers” was at the heart of the debate.

A report from the School of Urban Planning at McGill University, commissioned by the hotel workers union, found that nearly half of the New York City rental revenue on Airbnb was earned by 10 percent of hosts in the city, undercutting the company’s argument that regular New Yorkers benefit widely from short-term rentals.

“Occasional hosts might be the numerical majority of hosts, but they account for a surprisingly small proportion of the actual rental activity on Airbnb and earn a surprisingly small proportion of the actual revenue,” the report said.

An April report from the City Comptroller’s Office found that Airbnb was exacerbating the city’s affordable housing crisis, especially in crowded or gentrifying neighborhoods. Overall, renters paid an additional $616 million in 2016 because of Airbnb, according to the report.

Airbnb disputed the methodology of both reports, accusing the McGill authors of having an “anti-home-sharing bias.” And on Wednesday, the day of the City Council vote, an Airbnb host sued the city, alleging retaliation for speaking out in support of home-sharing in June. Airbnb is financing the host’s suit.

City officials said the bill focused primarily on large-scale commercial landlords who were gaming the system.

“Yes, sometimes it’s the common New Yorker,” said Councilwoman Carlina Rivera, who introduced the bill. “But many times, especially in my district, these are landlords who are taking rent-regulated units out of the housing stock because they’d rather get a lot more money per night.”