Read API #4143
-
|
Are there any forms of read API that you can use to extract the data from Umami? I only see a write API, to add analytics. The only way to read the data is to log in. And the website is written in client-side JavaScript, and auth is in JavaScript. So you can use web scraping to read the statistics. If direct access to the database is the only way, then maybe you have something that helps with that? Do I need to read the source code and write my own tool in order to read the analytics? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Yeah — you don’t need to scrape the UI or dig through the client code 🙂 Umami actually exposes read endpoints (the same ones the dashboard uses internally). It’s just not super obvious from the docs at first glance. You can fetch analytics data via REST APIs like:
Auth depends on your setup:
So yeah, no need to touch the DB or reverse-engineer anything. Just call the endpoints the dashboard already relies on. Only thing to note: the API isn’t heavily documented, but it’s stable enough since the UI depends on it. |
Beta Was this translation helpful? Give feedback.
Yeah — you don’t need to scrape the UI or dig through the client code 🙂
Umami actually exposes read endpoints (the same ones the dashboard uses internally). It’s just not super obvious from the docs at first glance.
You can fetch analytics data via REST APIs like:
Auth depends on your setup:
So yeah, no need to touch the DB or reverse-engineer anything. Just call the endpoints the dashboard already relies on.
Only thing to note: the API isn’t heavily documented, but it’s stable enough since the UI depends on it.