canonical: https://jentic.com/apis/swetrix.com/swetrix

# Swetrix API

Swetrix is an open-source, lightweight, and privacy-focused web analytics platform. This API provides endpoints for statistics retrieval, event tracking, and project administration. The API exposes 24 endpoints secured with apiKey authentication.

## For AI agents

Programmatically get traffic analytics data, get performance metrics. Covers 24 operations with apiKey authentication.

## Scope

Does not handle payments, communications, or crm - use for analytics only.

## Capabilities

- Get traffic analytics data
- Manage analytics data programmatically
- Integrate Swetrix API into automated workflows
- Query and filter Swetrix API records by parameters
- Monitor Swetrix API operational status and events

## Use cases

### Analytics Operations

Use the Swetrix API to perform analytics operations programmatically. The API provides 24 endpoints covering core functionality including get traffic analytics data, get performance metrics, get summary of log data.

Example prompt: Call GET `/v1/log` to get traffic analytics data

### Automated Log Management

Automate log operations by combining multiple Swetrix API endpoints. Agents can get performance metrics and then get summary of log data in a single workflow.

Example prompt: Call GET `/v1/log/performance` to get performance metrics, then verify the result

### AI Agent Integration via Jentic

AI agents discover and call Swetrix API endpoints through Jentic without managing credentials directly. An agent searches for the required operation by intent, receives the matching endpoint schema, and executes the call with Jentic-managed authentication. This eliminates the need to read API documentation or handle apiKey tokens manually.

Example prompt: Search Jentic for 'get traffic analytics data', load the operation schema, and execute with Jentic-managed credentials

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/v1/log` | Get traffic analytics data |
| GET | `/v1/log/performance` | Get performance metrics |
| GET | `/v1/log/birdseye` | Get summary of log data |
| GET | `/v1/log/live-visitors` | Get live visitors |
| GET | `/v1/log/hb` | Get heartbeat event counts |
| GET | `/v1/log/sessions` | Get sessions list |
| GET | `/v1/log/session` | Get single session details |
| GET | `/v1/log/funnel` | Get funnel analysis |

## Key resources

- **Log** — Operations for log
- **Organisation** — Operations for organisation
- **Project** — Operations for project

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 62 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 75 / 100
  - Developer Experience & Jentic Compatibility: 63 / 100
  - AI-Readiness & Agent Experience: 47 / 100
  - Agent Usability: 94 / 100
  - Security: 50 / 100
  - AI Discoverability: 66 / 100
- **View full report:** https://jentic.com/apis/swetrix.com/swetrix/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring the Swetrix API by hand means passing its API-key request header on every call against api.swetrix.com and managing its log, project, and organisation routes yourself. Through Jentic you install once, import the Swetrix API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** The Swetrix API puts each resource id in the URL path (`/v1/project/{id}`, `/v1/organisation/{orgId}`), so a rule can pin your agent to one project or organisation: it can read its analytics and update that record and nothing else. You choose the operations it may call, so destructive ones like deleting a project or an organisation are not included unless you add them.
- **Credential handling:** Your Swetrix API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'get traffic analytics data' or 'fetch a project funnel', and Jentic returns the matching Swetrix API operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Mixpanel** — Alternative analytics API
- **Amplitude** — Alternative analytics API
- **Segment** — Complementary analytics API
- **Pendo** — Complementary analytics API

## FAQ

### What authentication does the Swetrix API use?

The Swetrix API uses an API key passed in the `X-Api-Key` header. Through Jentic, these credentials are stored encrypted in your Jentic One instance and injected at execution time, so raw secrets never enter the agent context.

### Can I get traffic analytics data with the Swetrix API?

Yes. Use the GET `/v1/log` endpoint. The API returns structured JSON responses that agents can parse and act on directly.

### What are the rate limits for the Swetrix API?

Rate limits are not specified in the OpenAPI spec. Check the vendor documentation for current limits. Through Jentic, rate limiting is handled automatically with retry logic built into the execution layer.

### How do I get traffic analytics data through Jentic?

Install the Jentic SDK with pip install jentic, authenticate through Jentic One, the self-hosted execution layer, then search for 'get traffic analytics data'. Jentic returns the matching Swetrix API operation with its input schema. Load the schema and execute the call - credentials are injected automatically.

### How many endpoints does the Swetrix API have?

The Swetrix API exposes 24 endpoints covering log, organisation, project operations.

### Can I limit what my agent is allowed to do with the Swetrix API?

Yes. Because you run Jentic One yourself, your own rules decide which Swetrix operations and credentials the agent may use. Since the Swetrix API puts each resource id in the URL path, such as `/v1/project/{id}` and `/v1/organisation/{orgId}`, you can pin the agent to a single project or organisation so it only reads that record's analytics and updates it. You also choose the exact operations it may call, so destructive actions like deleting a project or an organisation are excluded unless you add them.
