Cards due at beginning of today

How can I determine how many cards were due (new + learn + review) at the beginning of today, after today has already started?

I’ve tried using deck_tree which works locally and for some users, but overcounts in this case for one of my users: they have a large deck unsuspended but the new card limit at 100 - deck_tree for them shows 16000 cards due.

I’ve changed my method to len(mw.col.find_cards(‘is:due’)), which seems to undercount - it returns 521 for this case:

Am I doing something wrong?