How to get site traffic data

Normally in a Wix site, I would be able to go to the Analytics & Reports page and see site traffic and pageview data (such as the “traffic over time” table). How would I be able to access this table/data through JS code in velo or the rest api?