bobvann / cf-dump

Cloudflare analytics export to CSV
MIT License
8 stars 3 forks source link

Script not working with new GraphQL API #2

Open sebastiantrella opened 3 years ago

sebastiantrella commented 3 years ago

Error: [{"code":1015,"message":"Zone Analytics API is sunset and replaced by GraphQL API"}]

Can please someone update this to work with the new API?

TimDaub commented 3 years ago

[{"code":1015,"message":"Zone Analytics API is sunset and replaced by GraphQL API"}]

sebastiantrella commented 3 years ago

anyone?

TimDaub commented 3 years ago

I needed the 30-day unique website visitors from Cloudflare and since I found their new graphql API over-complicated, I ended up looking through the XHR requests that are done when loading the analytics dashboard. From their pricing structure, it's unclear to me if I can get the 30-day unique visitors from their website on a free plan. Anyways, it turned out that I just copy the request from their dashboard through my browser's inspector and filter it using jq. For me, it ended up being this query:

cat cloudflare.json | jq ".data.viewer.zones[0].zones[0].uniq.uniques"

PS: Gotta love when company's use the euphemism "sunset" in an API response to politely express that they've stopped or deleted a useful service.

sebastiantrella commented 1 year ago

I am still searching for an updated version of that script or a alternative that easily downloads all my Analytics Data for all my zones. @bobvann, can you help?