Since 2017 the air quality has been greatly improved for Beijing. I just spent about three weeks there and the sky is surprisingly blue
Factories are closed at the moment. The skies tend to clear up when that happens.
The same thing also happens in other cities when there's a big central government visit (e.g. Xi Jinping) planned.
I was there for a week in November (from NE USA) and our group had respiratory issues with the air there. Shanghai later in the trip was much better. I know it used to be worse, but it still isn't what I'd call good.