1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "subscriptions": [
12 {
13 "customer_id": "SAMPLE-1",
14 "start_date": "2026-01-05",
15 "mrr": 49
16 },
17 {
18 "customer_id": "SAMPLE-2",
19 "start_date": "2026-02-10",
20 "end_date": "2026-05-10",
21 "amount": 588,
22 "interval": "year"
23 }
24 ]
25};
26
27
28const run = await client.actor("cleancellco/saas-metrics-cohort-report").call(input);
29
30
31console.log('Results from dataset');
32console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
33const { items } = await client.dataset(run.defaultDatasetId).listItems();
34items.forEach((item) => {
35 console.dir(item);
36});
37
38