1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "cashModel": {
9 "company": "Example Technology Inc.",
10 "currency": "USD",
11 "startDate": "2026-09-07",
12 "openingCash": 2400000,
13 "availableCreditLine": 750000,
14 "collections": [
15 {
16 "customer": "Customer A (monthly invoice)",
17 "weeks": {
18 "2": 620000,
19 "6": 620000,
20 "11": 620000,
21 },
22 },
23 {
24 "customer": "Customer B (project payment)",
25 "weeks": { "8": 900000 },
26 },
27 {
28 "customer": "Other customers (every week)",
29 "weekly": 300000,
30 },
31 ],
32 "otherInflows": [{
33 "item": "Grant payment",
34 "week": 9,
35 "amount": 250000,
36 }],
37 "expenses": [
38 {
39 "item": "Payroll and social security",
40 "amount": 1150000,
41 "frequency": "monthly",
42 "paymentDay": 5,
43 },
44 {
45 "item": "Rent",
46 "amount": 180000,
47 "frequency": "monthly",
48 "paymentDay": 1,
49 },
50 {
51 "item": "SaaS and infrastructure",
52 "amount": 95000,
53 "frequency": "monthly",
54 "paymentDay": 15,
55 },
56 {
57 "item": "Marketing",
58 "amount": 45000,
59 "frequency": "weekly",
60 },
61 {
62 "item": "Taxes and withholding",
63 "amount": 320000,
64 "frequency": "monthly",
65 "paymentDay": 26,
66 },
67 {
68 "item": "Loan instalment",
69 "amount": 210000,
70 "frequency": "monthly",
71 "paymentDay": 20,
72 },
73 {
74 "item": "Supplier payments (share of collections)",
75 "rate": 0.22,
76 "frequency": "variable",
77 },
78 {
79 "item": "Annual insurance premium",
80 "amount": 90000,
81 "frequency": "one-off",
82 "week": 7,
83 },
84 ],
85 "scenarios": {
86 "base": {
87 "collectionMultiplier": 1,
88 "expenseMultiplier": 1,
89 "collectionDelayWeeks": 0,
90 },
91 "best": {
92 "collectionMultiplier": 1.1,
93 "expenseMultiplier": 0.97,
94 "collectionDelayWeeks": 0,
95 },
96 "worst": {
97 "collectionMultiplier": 0.8,
98 "expenseMultiplier": 1.05,
99 "collectionDelayWeeks": 2,
100 },
101 },
102 "thresholdWeeks": 4,
103 "pastMonthlyNetCash": [
104 -310000,
105 -280000,
106 -350000,
107 ],
108 "actuals": { "1": {
109 "inflow": 280000,
110 "outflow": 125000,
111 } },
112 } }
113
114
115run = client.actor("bloom-consulting/cash-runway-13-week").call(run_input=run_input)
116
117
118print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
119for item in client.dataset(run.default_dataset_id).iterate_items():
120 print(item)
121
122