What this API does
The Umami Analytics API is an open-source, privacy-focused tool designed to provide detailed website analytics without compromising user data. It offers developers easy access to key metrics such as visitor counts, page views, referrer data, and custom event tracking through simple RESTful endpoints. The API ensures GDPR compliance by being cookie-free and secure, making it ideal for privacy-conscious applications.
How it works
Developers can integrate the API by using a lightweight 2KB tracking script on their websites. The API supports HTTP GET requests to retrieve analytics data, which is returned in JSON format. This makes it easy to integrate with various development environments. Metrics are collected in real-time, allowing for efficient monitoring and reporting.
Authentication
Access to the Umami Analytics API requires an API key, which should be included in the headers of the requests to ensure secure access. This authentication method helps maintain the integrity of the data and limits unauthorized access to the API endpoints.
Example usage
/api/v1/visitors- Retrieves the total visitor count for the specified site./api/v1/events- Fetches custom event tracking data./api/v1/pages- Provides page views statistics./api/v1/referrers- Lists referrer data for the site.
Limits
The API documentation does not specify any rate limits, allowing developers to make requests as needed. However, best practices for API usage should be observed to ensure efficient performance.
Ideal use cases
- Building real-time dashboards to monitor website performance.
- Creating custom reporting tools for web analytics.
- Integrating analytics capabilities into privacy-focused web applications.
- Providing detailed visitor insights for e-commerce platforms.