Skip to main content

Fake Analytics Session Data API

MOCK DATA

Generate privacy-safe analytics sessions and funnel summaries with exact event order, timing, outcome, conversion and revenue arithmetic.

Generated test data for fixtures and development

Base URL
/api/analytics-sessions
Capabilities
2 routes Seedable
Last updated
July 29, 2026

GET /api/analytics-sessions

Live requestRuns against the public API
No key required
GET/api/analytics-sessions?count=8&seed=42

Request parameters

Mix outcomes or force bounced (1 event), engaged (2–8, no purchase) or converted (5–8, purchase last).

Mix acquisition channels or constrain every session to one channel.

Mix client classes or constrain coherent browser, OS and viewport profiles to one device class.

Inclusive minimum event count; must not exceed maxEvents or conflict with a forced outcome.

Inclusive maximum event count; nested arrays stay bounded to eight events.

Inclusive lower bound for synthetic session start, not end.

Inclusive upper bound for session start; the from/to span may not exceed 366 days.

Advanced response options7 options

How many records to generate (1–100).

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/analytics-sessions?count=8&seed=42"
const res = await fetch("https://randomapi.dev/api/analytics-sessions?count=8&seed=42");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/analytics-sessions?count=8&seed=42").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/analytics-sessions?count=8&seed=42"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 7
outcome enum

Mix outcomes or force bounced (1 event), engaged (2–8, no purchase) or converted (5–8, purchase last).

default: any
allowed: any | bounced | engaged | converted
example: outcome=converted
channel enum

Mix acquisition channels or constrain every session to one channel.

default: any
allowed: any | direct | organic | referral | email | paid
example: channel=organic
device enum

Mix client classes or constrain coherent browser, OS and viewport profiles to one device class.

default: any
allowed: any | desktop | mobile | tablet
example: device=mobile
minEvents int

Inclusive minimum event count; must not exceed maxEvents or conflict with a forced outcome.

default: 1
allowed: 1 – 8
example: minEvents=3
maxEvents int

Inclusive maximum event count; nested arrays stay bounded to eight events.

default: 8
allowed: 1 – 8
example: maxEvents=6
from date

Inclusive lower bound for synthetic session start, not end.

default: 2026-06-01
example: from=2026-06-10
to date

Inclusive upper bound for session start; the from/to span may not exceed 366 days.

default: 2026-06-30
example: to=2026-06-20
Universal parameters Shared response and formatting options 7
count int

How many records to generate (1–100).

default: 10
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=sessionId,anonymousId
exclude list

Return all fields except these (comma-separated).

example: exclude=events
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 14
sessionId string

Distinct ses_-prefixed synthetic session identifier.

example: ses_01_a1b2c3d4e5f6

anonymousId string

Explicit fixture label, never a real cookie, account or device identifier.

example: anon_fixture_1_a1b2c3d4

startedAt string (ISO 8601)

First event time inside the requested start window.

example: 2026-06-12T10:00:00.000Z

endedAt string (ISO 8601)

Exact final event time; equals startedAt for a one-event bounce.

example: 2026-06-12T10:04:00.000Z

durationSeconds integer

Exact endedAt minus startedAt in seconds.

example: 240

outcome string

bounced | engaged | converted, derived coherently from the event funnel.

example: converted

channel string

Synthetic acquisition channel.

example: organic

client object

Non-identifying coherent device/browser/OS/viewport fixture plus an RFC documentation IP.

example: {"device":"mobile","browser":"Safari","os":"iOS","viewport":{"width":390,"height":844},"locale":"en-US","ip":"192.0.2.1"}

eventCount integer

Exact events.length within requested bounds.

example: 5

pageviewCount integer

Exact count of landing_view plus product_view events.

example: 2

converted boolean

True exactly when outcome is converted and one purchase event exists.

example: true

revenueCents integer

Purchase value in integer cents, or zero without conversion.

example: 8999

funnel object

Derived step booleans, deepest stage and completed-step count.

example: {"landing":true,"productViewed":true,"carted":true,"checkoutStarted":true,"purchased":true,"deepestStage":"purchase","completedSteps":5}

events object[]

One to eight strictly ordered synthetic events with exact sequence, path and purchase value semantics.

example: [{"eventId":"ses_01_a1_e0","sequence":0,"type":"landing_view","occurredAt":"2026-06-12T10:00:00.000Z","path":"/","valueCents":null}]

Documented examples

Build-generated requests and complete responses
3
Mixed privacy-safe analytics sessions
GET /api/analytics-sessions?count=8&seed=42
{
  "data": [
    {
      "sessionId": "ses_01_8016cfb6a5c8",
      "anonymousId": "anon_fixture_1_5eac58cd",
      "startedAt": "2026-06-25T20:07:58.309Z",
      "endedAt": "2026-06-25T20:12:33.309Z",
      "durationSeconds": 275,
      "outcome": "engaged",
      "channel": "referral",
      "client": {
        "device": "desktop",
        "browser": "Safari",
        "os": "macOS",
        "viewport": {
          "width": 1374,
          "height": 1046
        },
        "locale": "en-US",
        "ip": "198.51.100.1"
      },
      "eventCount": 6,
      "pageviewCount": 6,
      "converted": false,
      "revenueCents": 0,
      "funnel": {
        "landing": true,
        "productViewed": true,
        "carted": false,
        "checkoutStarted": false,
        "purchased": false,
        "deepestStage": "product",
        "completedSteps": 2
      },
      "events": [
        {
          "eventId": "ses_01_8016cfb6a5c8_e0",
          "sequence": 0,
          "type": "landing_view",
          "occurredAt": "2026-06-25T20:07:58.309Z",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Converted mobile sessions
GET /api/analytics-sessions?outcome=converted&device=mobile&minEvents=5&maxEvents=7&count=4&seed=7
{
  "data": [
    {
      "sessionId": "ses_01_92c7e2436f61",
      "anonymousId": "anon_fixture_1_bcde1a23",
      "startedAt": "2026-06-14T22:44:03.417Z",
      "endedAt": "2026-06-14T22:50:53.417Z",
      "durationSeconds": 410,
      "outcome": "converted",
      "channel": "paid",
      "client": {
        "device": "mobile",
        "browser": "Chrome",
        "os": "Android",
        "viewport": {
          "width": 416,
          "height": 746
        },
        "locale": "en-US",
        "ip": "198.51.100.1"
      },
      "eventCount": 7,
      "pageviewCount": 4,
      "converted": true,
      "revenueCents": 24647,
      "funnel": {
        "landing": true,
        "productViewed": true,
        "carted": true,
        "checkoutStarted": true,
        "purchased": true,
        "deepestStage": "purchase",
        "completedSteps": 5
      },
      "events": [
        {
          "eventId": "ses_01_92c7e2436f61_e0",
          "sequence": 0,
          "type": "landing_view",
          "occurredAt": "2026-06-14T22:44:03.417Z",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Organic June engagement fixtures
GET /api/analytics-sessions?outcome=engaged&channel=organic&from=2026-06-10&to=2026-06-20&count=5&seed=19
{
  "data": [
    {
      "sessionId": "ses_01_cd4d76736c92",
      "anonymousId": "anon_fixture_1_6a429264",
      "startedAt": "2026-06-14T23:32:35.163Z",
      "endedAt": "2026-06-14T23:34:14.163Z",
      "durationSeconds": 99,
      "outcome": "engaged",
      "channel": "organic",
      "client": {
        "device": "desktop",
        "browser": "Chrome",
        "os": "Windows",
        "viewport": {
          "width": 1868,
          "height": 1114
        },
        "locale": "fr-FR",
        "ip": "198.51.100.1"
      },
      "eventCount": 2,
      "pageviewCount": 2,
      "converted": false,
      "revenueCents": 0,
      "funnel": {
        "landing": true,
        "productViewed": true,
        "carted": false,
        "checkoutStarted": false,
        "purchased": false,
        "deepestStage": "product",
        "completedSteps": 2
      },
      "events": [
        {
          "eventId": "ses_01_cd4d76736c92_e0",
          "sequence": 0,
          "type": "landing_view",
          "occurredAt": "2026-06-14T23:32:35.163Z",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

GET /api/analytics-sessions/funnels

Live requestRuns against the public API
No key required
GET/api/analytics-sessions/funnels?count=10&seed=42

Request parameters

Mix outcomes or force bounced (1 event), engaged (2–8, no purchase) or converted (5–8, purchase last).

Mix acquisition channels or constrain every session to one channel.

Mix client classes or constrain coherent browser, OS and viewport profiles to one device class.

Inclusive minimum event count; must not exceed maxEvents or conflict with a forced outcome.

Inclusive maximum event count; nested arrays stay bounded to eight events.

Inclusive lower bound for synthetic session start, not end.

Inclusive upper bound for session start; the from/to span may not exceed 366 days.

Advanced response options7 options

How many records to generate (1–100).

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/analytics-sessions/funnels?count=10&seed=42"
const res = await fetch("https://randomapi.dev/api/analytics-sessions/funnels?count=10&seed=42");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/analytics-sessions/funnels?count=10&seed=42").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/analytics-sessions/funnels?count=10&seed=42"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 7
outcome enum

Mix outcomes or force bounced (1 event), engaged (2–8, no purchase) or converted (5–8, purchase last).

default: any
allowed: any | bounced | engaged | converted
example: outcome=converted
channel enum

Mix acquisition channels or constrain every session to one channel.

default: any
allowed: any | direct | organic | referral | email | paid
example: channel=organic
device enum

Mix client classes or constrain coherent browser, OS and viewport profiles to one device class.

default: any
allowed: any | desktop | mobile | tablet
example: device=mobile
minEvents int

Inclusive minimum event count; must not exceed maxEvents or conflict with a forced outcome.

default: 1
allowed: 1 – 8
example: minEvents=3
maxEvents int

Inclusive maximum event count; nested arrays stay bounded to eight events.

default: 8
allowed: 1 – 8
example: maxEvents=6
from date

Inclusive lower bound for synthetic session start, not end.

default: 2026-06-01
example: from=2026-06-10
to date

Inclusive upper bound for session start; the from/to span may not exceed 366 days.

default: 2026-06-30
example: to=2026-06-20
Universal parameters Shared response and formatting options 7
count int

How many records to generate (1–100).

default: 10
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=sessionId,outcome
exclude list

Return all fields except these (comma-separated).

example: exclude=revenueCents
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 11
sessionId string

ID shared with the root session for identical params, seed and record index.

example: ses_01_a1b2c3d4e5f6

outcome string

bounced | engaged | converted.

example: converted

eventCount integer

Exact sum of all five event-type counters.

example: 5

landingViews integer

Always one for a valid generated session.

example: 1

productViews integer

One or more after the landing for engaged/converted sessions.

example: 1

addToCartEvents integer

Zero or one, coherent with deepestStage.

example: 1

checkoutEvents integer

Zero or one, never present before add-to-cart.

example: 1

purchaseEvents integer

Exactly one only for converted sessions.

example: 1

deepestStage string

landing | product | cart | checkout | purchase.

example: purchase

converted boolean

True exactly when purchaseEvents is one.

example: true

revenueCents integer

Same integer-cent total as the source session.

example: 8999

Documented examples

Build-generated requests and complete responses
3
Aggregate a mixed synthetic cohort
GET /api/analytics-sessions/funnels?count=10&seed=42
{
  "data": [
    {
      "sessionId": "ses_01_8016cfb6a5c8",
      "outcome": "engaged",
      "eventCount": 6,
      "landingViews": 1,
      "productViews": 5,
      "addToCartEvents": 0,
      "checkoutEvents": 0,
      "purchaseEvents": 0,
      "deepestStage": "product",
      "converted": false,
      "revenueCents": 0
    },
    {
      "sessionId": "ses_02_f248abeccba6",
      "outcome": "bounced",
      "eventCount": 1,
      "landingViews": 1,
      "productViews": 0,
      "addToCartEvents": 0,
      "checkoutEvents": 0,
      "purchaseEvents": 0,
      "deepestStage": "landing",
      "converted": false,
      "revenueCents": 0
    },
    {
      "sessionId": "ses_03_90902c05ac83",
      "outcome": "converted",
      "eventCount": 5,
      "landingViews": 1,
      "productViews": 1,
      "addToCartEvents": 1,
      "checkoutEvents": 1,
      "purchaseEvents": 1,
      "deepestStage": "purchase",
      "converted": true,
      "revenueCents": 8051"generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Purchase funnel summaries
GET /api/analytics-sessions/funnels?outcome=converted&minEvents=5&maxEvents=8&count=5&seed=7
{
  "data": [
    {
      "sessionId": "ses_01_2c7e2436f61b",
      "outcome": "converted",
      "eventCount": 7,
      "landingViews": 1,
      "productViews": 3,
      "addToCartEvents": 1,
      "checkoutEvents": 1,
      "purchaseEvents": 1,
      "deepestStage": "purchase",
      "converted": true,
      "revenueCents": 11940
    },
    {
      "sessionId": "ses_02_c0ed5cab8a9d",
      "outcome": "converted",
      "eventCount": 7,
      "landingViews": 1,
      "productViews": 3,
      "addToCartEvents": 1,
      "checkoutEvents": 1,
      "purchaseEvents": 1,
      "deepestStage": "purchase",
      "converted": true,
      "revenueCents": 16724
    },
    {
      "sessionId": "ses_03_b01cdce3b5a6",
      "outcome": "converted",
      "eventCount": 6,
      "landingViews": 1,
      "productViews": 2,
      "addToCartEvents": 1,
      "checkoutEvents": 1,
      "purchaseEvents": 1,
      "deepestStage": "purchase",
      "converted": true,
      "revenueCents": 22703"generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Bounce-only funnel rows
GET /api/analytics-sessions/funnels?outcome=bounced&minEvents=1&maxEvents=1&count=4&seed=23
{
  "data": [
    {
      "sessionId": "ses_01_5c7655efe735",
      "outcome": "bounced",
      "eventCount": 1,
      "landingViews": 1,
      "productViews": 0,
      "addToCartEvents": 0,
      "checkoutEvents": 0,
      "purchaseEvents": 0,
      "deepestStage": "landing",
      "converted": false,
      "revenueCents": 0
    },
    {
      "sessionId": "ses_02_623474fb59ed",
      "outcome": "bounced",
      "eventCount": 1,
      "landingViews": 1,
      "productViews": 0,
      "addToCartEvents": 0,
      "checkoutEvents": 0,
      "purchaseEvents": 0,
      "deepestStage": "landing",
      "converted": false,
      "revenueCents": 0
    },
    {
      "sessionId": "ses_03_e951c4a0f043",
      "outcome": "bounced",
      "eventCount": 1,
      "landingViews": 1,
      "productViews": 0,
      "addToCartEvents": 0,
      "checkoutEvents": 0,
      "purchaseEvents": 0,
      "deepestStage": "landing",
      "converted": false,
      "revenueCents": 0"generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

About this API

Coverage & behavior

Generates compact, fictional analytics sessions for dashboards, warehouses and funnel tests. It never emits names, emails, cookies, advertising IDs or secrets. anonymousId is visibly fixture-prefixed, client IPs come only from RFC documentation networks, and browser/OS/viewport combinations are generic synthetic profiles.

Each session is one coherent event story. A bounce contains exactly one landing event. Engaged sessions contain two to eight ordered funnel events but no purchase. Converted sessions contain five to eight events in the required order—landing, one or more product views, cart, checkout, then exactly one purchase. Session start/end, duration, event count, pageview count, funnel booleans and integer-cent revenue are derived rather than chosen independently.

/funnels projects the same seeded sessions into aggregate step counts. With identical params, seed and count, record N shares its session ID, outcome, totals and revenue with record N from the root route. Start windows are capped at 366 days and event arrays at eight, keeping 100-record fixtures inexpensive.

Use it for

  • Populate analytics dashboards without copying production identifiers
  • Test conversion funnels across bounce, engagement and purchase outcomes
  • Reconcile raw synthetic events with seeded aggregate funnel rows

Frequently asked questions

Does this analytics fixture include personal identifiers?

No. It omits names, emails, cookies and ad IDs; fixture-prefixed anonymous IDs and RFC documentation IP ranges are deliberately non-identifying.

How does a converted session differ from an engaged session?

Converted sessions end with exactly one purchase after cart and checkout and carry matching positive revenue. Engaged sessions never contain a purchase and always have zero revenue.

Can funnel summaries be matched back to generated sessions?

Yes. The same params, seed and count produce corresponding root and /funnels records with identical session ID, outcome, event total and revenue.

Standards & references