TORONTO - Ontario is promising to clamp down on online ticket scalping, a source of frustration and anger for fans who have often been unable to secure tickets to their favourite sport or music events.

The Liberal government said Monday it will introduce new legislation this fall that will make automated ticket-buying “bots” illegal. It would also cap markups on resold tickets at 50 per cent of their face value.

Under the proposed law, ticket resellers would have to disclose more information, including the face value of tickets and any surcharges.

The so-called “scalper bots” - software programs designed to purchase online a large number of tickets for a concert, show, or other event, enabling the person running the software to sell those tickets at a profit - made headlines last year when many Tragically Hip fans were unable to buy tickets to the band's farewell tour.

“By the time any real fan is able to log on and search for tickets the best seats are gone,” Yasir Naqvi, Ontario's attorney general, said as he made the announcement.

“Many events sell out completely in minutes, even seconds, and many of these tickets end up on resale sites for huge markups, of course.”

He has acknowledged, however, that enforcing a ban on scalper bots, which are not unique to Ontario, would be difficult.

Naqvi said major ticket sellers, including Ticketmaster, have told the government that they already employ technology to combat bots, which has been “fairly successful,” but they lack sufficient resources.

As a result, the government plans to give the industry and fans the right to sue those who use bots or facilitate the reselling of those tickets. Once it passed, the law would apply to tickets for events that take place in Ontario, regardless of where the ticket seller and buyer are based, Naqvi said.

Naqvi said the law would also make it illegal to sell tickets purchased with bots and to “facilitate” the resale of those tickets, which would affect the two biggest online ticket resellers in Ontario, Ticketmaster and StubHub.

Naqvi said both companies are capable of determining when scalpers dump large amounts of tickets, purchased by bots, on their sites for resale.

The new law would give those companies more information to work with, by requiring all entities that sell tickets on their sites to disclose basic contact information.

“That will be a very strong and blunt tool, because if you then see the same corporation selling a large number of tickets, perhaps even individually, it will be easier for StubHub to identify and look into where those tickets are coming from and why they're being sold,” he said.

Naqvi said capping the markup on tickets will give scalpers less financial incentive to use bots in the first place.

The changes are based on public feedback gathered through a survey conducted earlier this year, he said.

“Between bots, lack of transparency and unfair prices on resale sites, there is a pervasive sentiment that the system is rigged.”

The opposition Progressive Conservatives said price gouging in the ticket resale market is a “mess” of the Liberals' own making, noting that scalping was illegal in Ontario until the government changed the law in 2015, making it legal for tickets to be sold for more than their face value when the reseller can authenticate the ticket or offer a money-back guarantee.

“Their criticism ignores the fact that tickets were already being sold and bought online before 2015,” Naqvi said, adding that the government chose to regulate ticket sales because it could not stop them from taking place online.

StubHub said in a statement Monday that it supports legislation prohibiting the use of bots and Ticketmaster did not respond to requests for comment.