canonical: https://jentic.com/apis/piwik.pro/piwik

# Piwik PRO Analytics API

Piwik PRO Analytics API provides programmatic access to query analytics data, sessions, events, real-time data, and manage goals. Authentication uses OAuth2 client credentials. The API exposes 7 endpoints secured with oauth2 authentication.

## For AI agents

Programmatically create access token, execute analytics query. Covers 7 operations with oauth2 authentication.

## Scope

Does not handle payments, communications, or crm - use for identity and authentication only.

## Capabilities

- Create access token
- Execute analytics query
- Fetch sessions

## Use cases

### Identity and Authentication Operations

Use the Piwik PRO Analytics API to perform identity auth operations programmatically. The API provides 7 endpoints covering core functionality including create access token, execute analytics query, execute real-time query.

Example prompt: Call POST `/auth/token` to create access token

### Automated Analytics Management

Automate analytics operations by combining multiple Piwik PRO Analytics API endpoints. Agents can execute analytics query and then execute real-time query in a single workflow.

Example prompt: Call POST `/api/analytics/v1/query`/ to execute analytics query, then verify the result

### AI Agent Integration via Jentic

AI agents discover and call Piwik PRO Analytics 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 oauth2 tokens manually.

Example prompt: Search Jentic for 'create access token', load the operation schema, and execute with Jentic-managed credentials

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/auth/token` | Create access token |
| POST | `/api/analytics/v1/query/` | Execute analytics query |
| POST | `/api/analytics/v1/real-time-query/` | Execute real-time query |
| POST | `/api/analytics/v1/sessions/` | Fetch sessions |
| POST | `/api/analytics/v1/events/` | Fetch events |
| POST | `/api/analytics/v1/real-time-events/` | Fetch real-time events |
| POST | `/api/analytics/v1/manage/goals/` | Create a goal |

## Key resources

- **Analytics** — Operations for analytics
- **Auth** — Operations for auth

## 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:** 63 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 57 / 100
  - Developer Experience & Jentic Compatibility: 63 / 100
  - AI-Readiness & Agent Experience: 45 / 100
  - Agent Usability: 94 / 100
  - Security: 85 / 100
  - AI Discoverability: 75 / 100
- **View full report:** https://jentic.com/apis/piwik.pro/piwik/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 Piwik PRO Analytics by hand means implementing its OAuth 2.0 token exchange at `/auth/token`, resolving the per-account host, and handling retries yourself. Through Jentic you install once, import Piwik PRO Analytics from the API Directory, store the credential once, and your agent calls it.
- **Permission scoping:** You limit the agent to the operations it needs, such as running an analytics query or reading real-time events. Because you choose the allowed operations, managing goals stays out of scope unless you add it.
- **Credential handling:** Your Piwik PRO Analytics OAuth credential 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 'query analytics sessions' or 'read real-time events', and Jentic returns the matching Piwik PRO Analytics operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Auth0** — Alternative identity auth API
- **Okta** — Alternative identity auth API

## FAQ

### What authentication does the Piwik PRO Analytics API use?

The Piwik PRO Analytics API uses OAuth 2.0 for authorization. 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 create access token with the Piwik PRO Analytics API?

Yes. Use the POST `/auth/token` endpoint. The API returns structured JSON responses that agents can parse and act on directly.

### What are the rate limits for the Piwik PRO Analytics 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 create access token through Jentic?

Install the Jentic SDK with pip install jentic, authenticate through Jentic One, the self-hosted execution layer, then search for 'create access token'. Jentic returns the matching Piwik PRO Analytics API operation with its input schema. Load the schema and execute the call - credentials are injected automatically.

### How many endpoints does the Piwik PRO Analytics API have?

The Piwik PRO Analytics API exposes 7 endpoints covering analytics, auth operations.

### Can I limit what my agent is allowed to do with the Piwik PRO Analytics API?

Yes. Jentic One is self-hosted by you, so your own rules decide which Piwik PRO Analytics operations and credentials the agent may use. You can allow it to run an analytics query or read real-time events while keeping other operations, such as creating goals, out of scope until you add them. Because you choose the permitted operations, the agent can only call what you have explicitly enabled.
