Mortarboard Challenge Challenge

Given a user's ID, determine how many times they have hit the repcap.

Specs

On a given day, let's a user has hit the repcap if they had reputation that wasn't gained due to the repcap. Essentially, on any given day, if the user's net reputation change as calculated without any cap was different from their actual observed reputation change, then they hit the repcap.

Input/Output

Input will be a single integer, the user's ID.
Output will be a single integer, indicating the number of days for which they had reputation that was "lost".
I/O can be in any reasonable format.

Test Cases

Feel free to add your own ID and stats here. The brackets indicate which user it is, but that isn't part of the output. Don't include it.

input -&gt; output (username)
42649 -&gt; 0 (HyperNeutrino)
41723 -&gt; 7 (Fatalize)
46271 -&gt; 0 (Riker) (This user has obtained 200 rep twice, but never over)
JS ES6, 360 bytes

f=(i,p=1,d=[])=&gt;fetch(`https://api.stackexchange.com/2.2/users/${i}/reputation?site=codegolf&amp;pagesize=100&amp;page=${p}`).then(x=&gt;x.json()).then(j=&gt;(q=d.concat(j.items),j.has_more?f(i,p+1,q):(r=[],q.map(s=&gt;(r[d=new Date(s.on_date*1000),i=d.getDate()+d.getMonth()*32+d.getYear()*365]?r[i]+=s.reputation_change:r[i]=s.reputation_change)),r.filter(x=&gt;x&gt;200).length)))


Call it like f(user id). Returns a promise that resolves with the number of days that rep was lost.



Ungolfed:

f=(i,p=1,d=[])=&gt;fetch(`https://api.stackexchange.com/2.2/users/${i}/reputation?site=codegolf&amp;pagesize=100&amp;page=${p}&amp;key=kAc8QIHB*IqJDUFcjEF1KA((`).then(x=&gt;x.json()).then(j=&gt;{
    return (q=d.concat(j.items),
    j.has_more?
        f(i,p+1,q)

        :(r=[],
            q.map(s=&gt;(r[d=new Date(s.on_date*1000),
                i=d.getDate()+d.getMonth()*32+d.getYear()*365]?
                    r[i]+=s.reputation_change

                    :r[i]=s.reputation_change)),
            r.filter(x=&gt;x&gt;200).length
        )
    )
});