Behavioral intelligence API
SessionMood scores user behavior in real time — clicks, hesitations, errors, rage clicks — and returns a mood + a suggested action while the session is still live.
No PII required · GDPR ready · Zero dependencies
How it works
As your user interacts, POST behavioral events to the API — clicks, scrolls, errors, navigations. Batch them every few seconds.
POST /v1/sessions/:id/eventsThe API scores the session and returns a mood, a confidence score, and the signals it detected — updated after every batch.
GET /v1/sessions/:id/moodUse suggested_action to trigger the right intervention — live chat, help tooltip, engagement prompt — while the user is still there.
Why SessionMood
Traditional tools show you drop-off rates days later. SessionMood gives you a signal while the user is still on the page — in time to actually do something about it.
Mood is scored after every event batch. Your app knows a user is frustrated before they rage-quit — not in next week's report.
A plain REST API with no SDKs to install. If you can make a fetch request, you can integrate in an afternoon.
Every response includes a suggested_action. Show a tooltip, open chat, simplify the flow — your app decides what to do with it.
No PII required. Sessions are anonymous IDs you control. One DELETE call permanently purges all data.
Who uses this
Mood states
Rage clicks, repeated errors, rapidly escalating interactions
Backtracking, long pauses, hovering without acting, JS errors
Fast, direct, no hesitation, goal-oriented clicking
Wandering scroll, multi-page exploration, no clear destination
Long idle periods, minimal input, attention has drifted
Steady, moderate pace, task-oriented, deep in flow state
Event types
Send any combination of these in a single events array. The more signals you send, the more accurate the mood score.
User clicked an element. Fields: x, y, ts
Rapid repeated clicks on the same target. Fields: x, y, ts
User scrolled the page. Fields: speed, direction, ts
User paused while typing. Fields: duration_ms, ts
User reversed an in-app action. Fields: ts
User hit the browser back button. Fields: ts
User navigated to a new page. Fields: url, ts
A JS or app error occurred. Fields: message, ts
No activity detected. Fields: duration_ms, ts
User hovering over an element. Fields: duration_ms, ts
An input or element received focus. Fields: ts
An input or element lost focus. Fields: ts
Quick start
// No package needed — plain fetch API const API_KEY = 'your_api_key_here'; const BASE = 'https://session-mood-api-production.up.railway.app/v1'; const SESSION = 'user_abc123'; // any unique ID for this session // 1. Send events as the user interacts await fetch(`${BASE}/sessions/${SESSION}/events`, { method: 'POST', headers: { 'X-Api-Key': API_KEY, 'Content-Type': 'application/json' }, body: JSON.stringify({ events: [ { type: 'page_view', url: '/checkout', ts: Date.now() / 1000 }, { type: 'rage_click', x: 340, y: 210, ts: Date.now() / 1000 }, { type: 'error', message: 'Payment failed', ts: Date.now() / 1000 } ]}) }); // 2. Get the mood — act on it const mood = await fetch(`${BASE}/sessions/${SESSION}/mood`, { headers: { 'X-Api-Key': API_KEY } }).then(r => r.json()); // mood.mood → "frustrated" // mood.confidence → 0.89 // mood.suggested_action → "show_live_chat" if (mood.mood === 'frustrated') openLiveChat(); if (mood.mood === 'confused') showHelpTooltip(); if (mood.mood === 'disengaged') showEngagementPrompt();
# pip install requests import requests, time API_KEY = "your_api_key_here" BASE = "https://session-mood-api-production.up.railway.app/v1" SESSION = "user_abc123" HEADERS = {"X-Api-Key": API_KEY} # 1. Send events requests.post(f"{BASE}/sessions/{SESSION}/events", headers=HEADERS, json={"events": [ {"type": "page_view", "url": "/checkout", "ts": time.time()}, {"type": "rage_click", "x": 340, "y": 210, "ts": time.time()}, {"type": "error", "message": "Payment failed", "ts": time.time()}, ]} ) # 2. Get mood and act mood = requests.get(f"{BASE}/sessions/{SESSION}/mood", headers=HEADERS ).json() print(mood["mood"]) # "frustrated" print(mood["confidence"]) # 0.89 print(mood["suggested_action"]) # "show_live_chat"
# 1. Send events curl -X POST https://session-mood-api-production.up.railway.app/v1/sessions/user_abc/events \ -H "X-Api-Key: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "events": [ { "type": "page_view", "url": "/checkout", "ts": 1714900200 }, { "type": "rage_click", "x": 340, "y": 210, "ts": 1714900201 }, { "type": "error", "message": "Payment failed","ts": 1714900202 } ] }' # 2. Get mood curl https://session-mood-api-production.up.railway.app/v1/sessions/user_abc/mood \ -H "X-Api-Key: your_api_key_here" # Response: { "mood": "frustrated", "confidence": 0.89, "signals": ["rage_click_detected", "repeated_errors"], "suggested_action": "show_live_chat" }
Pricing
FAQ