Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: Derive Analytics API
version: 1.0.0
description: 'Derive''s HTTP API. Every response shape here is the single source of truth for the web client — generated from the same Zod schemas that back this reference, so the docs never drift from the running API.
**Auth:** a session cookie (browser) or a bearer token (agents and the CLI). Most write routes are scoped to the caller''s active workspace. The `/v1` paths are the stable product surface; `/openapi.json` serves this spec and `/docs` renders it.'
tags:
- name: Analytics
description: Aggregate view statistics for an artifact.
paths:
/v1/artifacts/{shortId}/view:
post:
tags:
- Analytics
summary: Record a view of an artifact (de-duped; owner self-views excluded)
parameters:
- schema:
type: string
required: true
name: shortId
in: path
responses:
'204':
description: Recorded (or skipped as a dup / self-view / disabled).
operationId: postV1ArtifactsByShortIdView
x-operation-id-source: derived
/v1/artifacts/{shortId}/analytics:
get:
tags:
- Analytics
summary: View stats for an artifact (collaborators only)
parameters:
- schema:
type: string
required: true
name: shortId
in: path
responses:
'200':
description: Totals, per-version + daily counts, and recent distinct viewers.
content:
application/json:
schema:
$ref: '#/components/schemas/Analytics'
operationId: getV1ArtifactsByShortIdAnalytics
x-operation-id-source: derived
components:
schemas:
Analytics:
type: object
properties:
total:
type: number
description: Total recorded views across all versions (de-duped opens)
last24h:
type: number
description: Views in the trailing 24 hours. A rolling window rather than a calendar day, so it carries no timezone assumption about the reader
unique:
type: number
description: Distinct viewers; a signed-in person or anon cookie counts once
anonViewers:
type: number
description: How many of the unique viewers are anonymous
reads:
type: number
description: Unique viewers who stayed, not just fetched (link previews do not count)
perVersion:
type: array
items:
type: object
properties:
version:
type: number
count:
type: number
description: Views recorded for that version
required:
- version
- count
daily:
type: array
items:
type: object
properties:
day:
type: string
description: Calendar day bucket (YYYY-MM-DD)
count:
type: number
description: Views recorded on that day
required:
- day
- count
recent:
type: array
items:
type: object
properties:
viewer:
type: string
description: Display name (resolved @handle for users), or the anon viewer id
kind:
type: string
enum:
- user
- anon
description: Whether the viewer is a signed-in user or anonymous
at:
type: string
description: When they last viewed (ISO timestamp)
avatar:
type:
- string
- 'null'
description: The user's avatar URL, or null/absent for anonymous viewers
required:
- viewer
- kind
- at
required:
- total
- last24h
- unique
- anonViewers
- reads
- perVersion
- daily
- recent