edgemesh / crux.run

The Chrome Real User Experience (CrUX) Database ... but faster
MIT License
7 stars 3 forks source link

API : Ability to flip (transpose) API fields #3

Closed jacobloveless closed 5 years ago

jacobloveless commented 5 years ago

Currently, the JSON responses are optimal for transmission but not for viewing. It would be nice to have a flag to return the JSON in a flipped format for easy import into things like excel. Ideally we could abandon the JSON format here altogether and embrace the CSV :)

SupremeTechnopriest commented 5 years ago

I can do what we did for our portal API. You set the accept header to either json, xml, or csv. I can implement this weekend when I get back to LA.

SupremeTechnopriest commented 5 years ago

You can flip any result set by appending the query parameter flip=true. If the flip param is present the result set will be flipped. It doesn't matter what flip is set to.

Example: https://api.crux.run/v1/histo/fcp/?domain=www.google.com&months=2&flip=true