Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ActivityWatch/activitywatch/llms.txt

Use this file to discover all available pages before exploring further.

ActivityWatch exposes a REST API at http://localhost:5600/api/0/ that provides full programmatic access to all activity data. The same API powers the web dashboard and is used by all watchers to send events.

Base URL

http://localhost:5600/api/0/
The API is only accessible on localhost by default. If you change the host setting to 0.0.0.0, the API becomes accessible on your local network.

Authentication

The API has no authentication by default — it is designed to be a local-only service. If you expose it on the network, you are responsible for securing access (e.g., with a reverse proxy and basic auth).

Response format

All responses are JSON. Timestamps follow ISO 8601 format in UTC. Durations are floating-point seconds.
{
  "id": 1,
  "timestamp": "2024-01-15T09:30:00.000000+00:00",
  "duration": 45.2,
  "data": { "app": "Firefox", "title": "ActivityWatch - GitHub" }
}

Available endpoints

ResourceEndpointDescription
InfoGET /api/0/infoServer version and hostname
BucketsGET /api/0/buckets/List all buckets
BucketsPOST /api/0/buckets/{id}Create a bucket
BucketsDELETE /api/0/buckets/{id}Delete a bucket and all its events
EventsGET /api/0/buckets/{id}/eventsGet events from a bucket
EventsPOST /api/0/buckets/{id}/eventsInsert one or more events
EventsDELETE /api/0/buckets/{id}/events/{event_id}Delete a single event
HeartbeatPOST /api/0/buckets/{id}/heartbeatSend a heartbeat
QueryPOST /api/0/query/Run a query against event data

Interactive API explorer

The built-in web UI includes a Query Explorer at http://localhost:5600/#/query. For the raw OpenAPI/Swagger interface (when using aw-server-rust), visit http://localhost:5600/swagger-ui/.

Buckets API

Create, list, and delete buckets

Events API

Read and write timestamped events

Query API

Filter and aggregate event data

Python Client

Use aw-client instead of raw HTTP

Build docs developers (and LLMs) love