Stream live activity
Server-sent events (text/event-stream; 406 when Accept refuses it): event for each pageview or event as it arrives (10 a second at most, the rest dropped), and count (visitors in the last 5 minutes) every 5 seconds. Members and API keys holding sessions:read (not share links) also get each visitor's detail: visitor on each pageview, and leave when a visitor goes. Share links pass their token as ?share=, since EventSource sets no headers. Access is checked again every minute, and a stream ends after an hour (EventSource reconnects). Open streams are capped per caller, per organization, per owner across organizations (a user with the API keys it created), and for guests per site (429).
Requires analytics:read on the site (an API key, or a signed-in member's role). Share links: allowed, with the analytics:read scope. Public sites: open to everyone, no credential needed.
x-api-key<token>An organization API key (ak_…), with the permissions and the sites it was created with. For servers and scripts: no cookie and no Origin check. Also accepted as Authorization: Bearer ak_… (apiKeyBearer). A request carries one credential: a key sent with a share token or a live session cookie is 400 (details.reason: ambiguous_credentials).
Scope: analytics:read
siteId*stringThe event stream
response?stringtext/event-streamevent, count, visitor and leave
curl -X GET 'https://pilotfox.app/api/v1/sites/string/live/stream'"string"