vercel / analytics

Privacy-friendly, real-time traffic insights
https://vercel.com/analytics
Mozilla Public License 2.0
437 stars 27 forks source link

Feature request: REST API #68

Open sanderpick opened 1 year ago

sanderpick commented 1 year ago

I know this just launched on Vercel, but I'm curious if there will be an API to query page views and events... ideally w/ SQL? Let me know if there's a better place to ask this too.

timolins commented 1 year ago

Yes, an API is on our roadmap. We will keep you updated. 🙌

mt-hagen commented 1 year ago

Hi @timolins - Will this also apply to the Speed Insights data? I would love to use this data for a cusotm reporting dashboard!

Svish commented 1 year ago

I was also looking for this, as it would be a great tool to use for example in generateStaticParams with Next.js.

Instead of pre-generating all or none of the dynamic pages, one could instead use this to for example generate the top N visited pages.

Would be awesome if @vercel/analytics exported some simple utility functions for this!

// Imagined usage in `./src/app/products/[id]/[slug]/page.tsx`

export async function generateStaticParams() {
  return getStaticParamsMatching('/products/[id]/[slug]', { limit: 50 })
}
masnwilliams commented 1 year ago

Pinging this again to see where this is on the roadmap. Would pay to be able to query analytics through this npm library with a queryAnalytics({ queryParams... }).

camcamcamcam commented 1 year ago

Really hoping this happens sometime in 2023 so I can use the analytics coming out of Vercel in a BI tool. Especially now that GA has become pretty useless with some recent law changes in Canada.

jtewright commented 1 week ago
spacecat commented 3 hours ago

Hi, I thought that this was already implemented but I learned today that it is not! 😬

Any ETA?

Thanks!