Skip to content
Fourohtwo

Builds the cohort table from the events you pass

tools.halowerk.com/v1/cohort/retention

Builds the cohort table from the events you pass: users grouped by the period of their first event, counted again in each following period. Returns the table per cohort, a retention curve across all cohorts, and, where events carry a value, cumulative value and value per user. The curve counts only cohorts old enough for a given period, so a young cohort is not scored as churn. Day, week and month

BaseUnchecked
POSThttps://tools.halowerk.com/v1/cohort/retention

UptimeNot checked yet

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://tools.halowerk.com/v1/cohort/retention", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"events":[{"time_unix_s":1785110400,"type":"order","user_id":"u1","value":19.9},{"time_unix_s":1785715200,"type":"order","user_id":"u1","value":24.5},{"time_unix_s":1785110400,"type":"order","user_id":"u2","value":12},{"time_unix_s":1785715200,"type":"order","user_id":"u3","value":30}],"period":"week","periods":3}),
});
console.log(await res.json());

Example input

{
  "events": [
    {
      "time_unix_s": 1785110400,
      "type": "order",
      "user_id": "u1",
      "value": 19.9
    },
    {
      "time_unix_s": 1785715200,
      "type": "order",
      "user_id": "u1",
      "value": 24.5
    },
    {
      "time_unix_s": 1785110400,
      "type": "order",
      "user_id": "u2",
      "value": 12
    },
    {
      "time_unix_s": 1785715200,
      "type": "order",
      "user_id": "u3",
      "value": 30
    }
  ],
  "period": "week",
  "periods": 3
}

More from HALOWERK Agent Tools