> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openrevenue.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Events

> Returns custom and transaction events ranked by count for the period, including summed tracker transaction amounts when a single currency is present. Works with an API key (ClickHouse-backed).

**domain** `string` *required*

Your project's domain, e.g. `example.com`.

**period** `string`

Time period. See Periods on [Account API](https://docs.openrevenue.com/api/account-api.md#periods) page. Defaults to 30d.

**limit** `integer`

Max results to return. Maximum 100, default 20.

## Response

**period** `string`

Resolved reporting period.

**data\[].name** `string`

Event name from track() or transaction().

**data\[].people** `number`

Unique visitors who fired the event.

**data\[].events** `number`

Total event count (custom + transaction).

**data\[].pct** `number`

Share of all events in the result set (0–1).

**data\[].amountCents** `number | null`

Sum of transaction amounts in minor units. Null when none, or when multiple currencies were recorded for the name.

**data\[].currency** `string | null`

ISO 4217 currency when amountCents is set; null otherwise.

**data\[].transactions** `number`

How many of events are type=transaction.

## Errors

| Status | Error | Description |
| - | - | - |
| `401` | `Invalid or missing API key` | The Authorization header is missing or the Bearer token is invalid. |
| `404` | `Project not found` | No project with that domain exists for the authenticated user. |

```javascript JavaScript theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
const res = await fetch("https://api.openrevenue.com/v1/projects/example.com/events?period=30d&limit=20", {
  headers: { Authorization: `Bearer ${OPENREVENUE_API_KEY}` },
})

const events = await res.json()
```

```bash cURL theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
curl "https://api.openrevenue.com/v1/projects/example.com/events?period=30d&limit=20" \
  -H "Authorization: Bearer openrevenue_your_key"
```

```json 200 theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
{
  "period": "30d",
  "data": [
    { "name": "signup", "people": 42, "events": 48, "pct": 0.61, "amountCents": null, "currency": null, "transactions": 0 },
    { "name": "purchase", "people": 12, "events": 15, "pct": 0.19, "amountCents": 149850, "currency": "USD", "transactions": 15 }
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.