Home
Support Forums

Netlify Analytics API

Hi.
I’m toying with an idea of moving my client’s news portal site to JAMstack (Ghost + 11ty + Netlify). There are a couple of things that I’d need to sort out before that endeavor, but my biggest problem is the requirement to have the “Most popular articles” widget.
I was hoping to get that information from Netlify Analytics, and only in build-time since the actual count is not important, but it seems that there is no API available for Netlify Analytics.

Have I missed something or I’ll have to pull my sleeves up and build something on my own with Firebase or FaunaDB?

Cheers.

Hey there,

That sounds like a great idea - at the moment, however, there isn’t an API endpoint you can query per se to pull the data and transform it in some way. We have an open feature request for this from a few folks, and I have added your voice to that issue, but i don’t have an ETA on when we might work on this at the moment.

There is some additional data and a workaround in this thread you should read, but it is a bit experimental. Nevertheless, it might work for your purposes.

Thank you @perry for your time and effort. I’ll follow up your suggestion.

Cheers.

1 Like

no problem. We will absolutely follow up with you should the engineering time decide to implement a different API - I can definitely see a use case for that.

Just want to chime is and say that I’d be interested in something similar as well :slight_smile: Basically the same use case of “Most popular content” widget or maybe marking some content as :fire: popular.

Hey there, @tomasz

Thank you for taking the time to share this idea! Feedback from the Forums members is incredibly useful, and I will share it with the appropriate teams :slight_smile:

1 Like

I’d like to bump this feature request as well! Hoping to build a feature into a dashboard where site analytics can be displayed.

1 Like

I would also like to bump this feature. We have over 50 sites on Netlify (expanding to 200 this year) and I would enable Analytics for every single one if it had an API.

Hi, @Brian_OC. We do have an open feature request for an Analytics API intended to be utilized by site owners.

If this feature becomes available, we will post an update here to let you know about it.

EDIT: I want to be clear @Brian_OC that each +1 like this is tracked and does get sent to our product managers to help them prioritize these feature requests. We do pay attention to each individual comment and each one is escalated to the appropriate product manager for the team in charge of that area.

yes please add analytics API endpoints, that would be great !

Hi @Yonnic,

There are undocumented APIs that do exist at the moment. You can use them, however, please proceed with caution as these APIs might change in the future without a warning.

But, you can go in the UI and open the developer tools to see the network requests being made to https://analytics.services.netlify.com/v1/<site-id>/.... This might not be the most ideal way to use the API, but might work for the time being depending on the use case.