FRANKFURT, Germany — Jens Wagner has worked the Frankfurt motor show for 20 years, selling hats emblazoned with car emblems for around 35 euros a pop, alongside T-shirts, jackets and miniature replica cars.

“If you look around, you’ll see for yourself what’s happening,” said Wagner, 47, pointing toward the thin crowds. “Less people, less exhibitors, less everything.”

He pines for what he remembers as the good old days, when roaring engines took pride of place ahead of whirring electric, when free markets prevailed over protectionism and when industry shows like this one really heaved.

While the 10-day show still draws tens of thousands of visitors, the number of exhibitors this year fell from around 994 to 830 as large names like Toyota and Ferrari stayed away. Others cut space, saying that they needed to find new innovative ways to connect with customers.

The decline of Germany’s biggest car show, which takes place every two years and wraps up this weekend, may say more about the public appetite for such events than about the auto industry itself, but it’s emblematic of the struggle the wider sector faces.

Carmakers are under pressure to lower emissions, transition away from gas and diesel and make autonomous driving a safe reality. The industry is still reeling from revelations that German car manufacturer Volkswagen cheated on emissions tests in an attempt to make its diesel engines look cleaner. On the opening weekend of the Frankfurt show, protesters blocked the entrance, a reminder of the ever present pressure over climate change.

On top of all that, the industry has taken a hit as a result of the uncertainty caused by President Trump’s trade war and by Brexit. And when the car industry in Europe’s largest economy is hurting, it can be bad news for the whole country — and the wider continent. 

A drop-off in manufacturing in Germany, particularly among carmakers, has led to a contraction that has economists warning that the country is probably headed into recession. Worried about the ripple effect, French policymakers are urging debt-averse Germany act to inject fiscal stimulus before it is too late.

Germany’s heavy dependence on exports leaves the country vulnerable to global trade fluctuations, with trade shrinking amid the uncertainty. 

“For Germany, that has a huge cost,” said Marcel Fratzscher, president of the German Institute for Economic Research, pointing out that exports as a whole make up nearly 50 percent of Germany’s GDP, compared with less than 15 percent of GDP in the United States. “This is the main reason that the German economy is actually now in recession.” 

Most economists define a technical recession as two consecutive quarters of economic decline. Germany’s economy contracted by 0.1 percent in the second quarter of the year compared with the previous three months. While definitive data for the latest quarter is not yet available, indications aren’t positive. 

Monthly data for July was “really horrific” and showed the trend continuing, said Carsten Brzeski, chief economist at ING Germany. 

“It looks as though we are currently in a recession,” he said. “Why is that? It’s really because of manufacturing, it’s because of cars, and it is because of [the] trade war and a series of other explanations.”

Henning Voepel, director of the Hamburg Institute of International Economics, said long-term trade trends bode poorly for Germany, which preferred the pre-Trump multilateral system based on “common rules” and a commitment to adjudicating disputes at the World Trade Organization. 

“I think we will not benefit from the future model of the global economy, because that will, for sure, be based on power and not on rules,” he said. 

In his office above the cavernous halls of the car show, Bernhard Mattes, the president of the German Association of the Automotive Industry, said German car manufacturers that export cars built in the United States to China had seen a decline from 120,000 to 95,000 units last year. 

“You can see this is not a minor effect, this is clearly a really serious effect,” he said. Trump has made the German car industry a favorite target for Twitter tirades, threatening to increase import tariffs on German cars.

Brexit is also taking a toll on the industry. Britain has traditionally been the No. 1 market for cars produced in Germany. But with the pound weak and the future uncertain, German exports to the United Kingdom have dropped 40 percent since the Brexit referendum in 2015, including a 20 percent dive for automakers. 

“The numbers are quite clear: Brexit is costing the German economy already,” said Gabriel Felbermayr, president of the Kiel Institute for the World Economy. 

Car manufacturers also worry about the possibility of a no-deal Brexit, without any managed transition to a new trade relationship. A sudden and chaotic Brexit could wreak havoc on their complex supply chains, which can involve parts crossing between Britain and Europe several times in the production process. 

But German automakers also have to take some of the blame for what’s happened, Felbermayr said: “The car industry is extremely important for Germany, and it’s generally weak, it’s losing market share in Europe, it’s losing market share at home.” 

The trade war doesn’t help, he said, but there are “homegrown” problems such as a sluggish switch-over to electric models — Chinese and U.S. companies have been quicker to act. 

While a recession technically may have taken hold, German economists said they did not expect it to be deep or severe — though uncertainty is the order of the day. 

The potential for recession has put renewed scrutiny on Germany’s zero-deficit policy, a long-standing commitment in a country where the word for “debt” comes from the word “guilt” and where Germans shun credit for savings. 

Last week, German finance minister Olaf Scholz said the government would, however, be ready to provide stimulus “if, indeed, an economic crisis erupts in Germany and Europe.”

Thirty minutes by train west of Frankfurt, the city of Rüsselsheim is synonymous with the German car industry. The red brick Opel administration building is part of a large industrial complex that has its own train station. Opel first started producing cars here in 1899. Formerly owned by General Motors, its purchase by French automaker Groupe PSA in 2017 was followed by redundancies.

“Fifty years ago, Rüsselsheim was only Opel, now it’s less and less,” said one 39-year-old employee as he stopped at a nearby grocery store. He spoke on the condition of anonymity because he was talking about his employer. “Everything’s okay if you don’t look at the future.”

Jeanne Whalen in Washington contributed to this report.