I am working with TROPOMI SO2 COBRA data and I am doing monthly averages over a defined region using bin_spatial() with harp in python. I want to find out how “good” the coverage in this region is after filtering the pixels using the recommended filter (qa_value>50). I found the “weight” variable in the documentation which “will contain the sum of weights for the contribution to each cell”. Is this the number of pixels used to calculate the new variables for the new grid cell?
And if yes I would simply calculate this weight variable with applying the filter and without applying the filter and calculate the ratio to determine the coverage. Or is there any other way to determine this?

The weight in the spatial binning is the sum of the overlapping fractions for each pixel. If the weight is 1 this means you have one full overlap (unless you have more than one overpass, which can happen near the poles within a single orbit).
If you want a fraction of what could have been covered pre-qa-filtered vs. actual qa-filtered, then the approach that you mentioned in terms of dividing the weight values would indeed be a valid approach.

If you are not looking near the poles, you can could assume a regular pre-filtered overpass weight of 1.0 per day per grid pixel.
For longer periods you would then use harpmerge with the bin() operation (see also other topics on this forum) to get the filtered weight. And then you just divide the two.

Note that to get filtered L3 you can download the SO2 COBRA L3 products from the S5P-PAL Data Portal. It is provided as daily, monthly, seasonal, and yearly grids. This already contains a full time series for the Volcanic (7km) SO2, and we are in the process of adding the full time series of the Anthropogenic (PBL) version as well for COBRA.