Fetch Unique products ordered per day

Hello All,

I have been working on creating a script that fetches the count of unique products ordered per day.

i.e :
in a single day: 5 times product A , 3 times product B and 2 times product C
the result should be 3

I have been doing this through retrieve list or orders API endpoint

/admin/api/2024-04/orders.json?created_at_min=' + min + 'T00:00:00+02&created_at_max=' + max + 'T00:00:00+02&status=any' + '&limit=250&fields=line_items'

and I am using paging to get full data, and iterate through line_items.product_id add them into a set then retrieve the set size.

however, I found that the numbers are a little bit different than those generated from the dashboard.

Any clue where the difference comes from ?
also is there any cleaner way to do this? like through a single graphQL query or something?