Skip to main content

Always Fresh MAU for Stunning Product Demos

Sales demos often need a working dashboard with real-looking data — but maintaining real APIs for demo purposes is costly and error-prone. You don’t want to write scripts to generate sample data daily just to keep charts alive.

With Beeceptor, you can create a mock JSON REST API that simulates Monthly Active Users (MAU) over the past 30 days — always fresh, no scripts needed.

increasing-mau-final-chart-chronological

Sample chart that looks shiny and bright

But How?

Use Beeceptor to build a mock API that returns live-looking data on demand. You can customize the JSON structure to match your real API’s contract, so integrating it into your frontend is a one-time job. Ask your developers to wire it in once, and from that point on, your sales team can confidently run live dashboards that look like the real thing — without touching production or chasing down data every time.

Let’s break down the final goal into smaller, manageable steps. We'll start by using the #repeat block to generate a fixed MAU value for 30 days. From there, we’ll gradually enhance the response template to make the data dynamic, realistic, and demo-ready.

Step 1 – Generate Static 30-Day Data

Let’s start by building the basic structure of this JSON API. The goal is to return an array of 30 entries — one for each day — with consistent date and mau fields. This gives us a predictable, stable API contract to build on.

Beeceptor Response Template

[
{{#repeat 30}}
{
"date": "{{now 'iso'}}",
"mau": 10000
}
{{/repeat}}
]

📘 What’s Happening

Sample Output

[
{ "date": "2025-04-06T18:30:00.000Z", "mau": 10000 },
{ "date": "2025-04-06T18:30:00.000Z", "mau": 10000 },
{ "date": "2025-04-06T18:30:00.000Z", "mau": 10000 },
{ "date": "2025-04-06T18:30:00.000Z", "mau": 10000 },
...
]

mau-static

Step 2 – Add Dynamic Dates and Random Values

Now that you have the basic shape of the API response, it’s time to make the data look more realistic. Showing the same MAU value for every date doesn't reflect real-world usage patterns — and definitely won't impress during a demo.

Updated Response Template

[
{{#repeat 30}}
{
"date": "{{now (object days=(multiply @index -1)) 'iso'}}",
"mau": {{faker 'number.int' '{min:10000, max:100000}'}}
}
{{/repeat}}
]

📘 What’s New

  • @index: Index of the current iteration (0–29)
  • (multiply @index -1): Picking the current iteration index and multiplying it with -1.
  • {{object days=-1}}: Helps in moving backward in time, by building an object for internal processing, which is given to {{now}}.
  • {{faker 'number.int'}}: Generates random values within a range

Sample Output

[
{ "date": "2025-04-06T00:00:00Z", "mau": 53782 },
{ "date": "2025-04-05T00:00:00Z", "mau": 68442 },
{ "date": "2025-04-04T00:00:00Z", "mau": 98340 },
{ "date": "2025-04-05T00:00:00Z", "mau": 59442 },
...
]

mau-random

Step 3 – Simulate Growth Over Time

To simulate user base growth over time, use the @index to gradually increase the mau values. However, keep in mind that at this stage, the dates are still ordered from newest to oldest, since @index 0 maps to today and increments backward. Don't worry, this will be fixed later.

Updated Response Template

[
{{#repeat 30}}
{
"date": "{{now (object days=(multiply @index -1)) 'iso'}}",
"mau": {{add 10000 (multiply (faker 'number.int' '3000') @index)}}
}
{{/repeat}}
]

📘 What’s New

  • {{add 10000 (...)}}: Attempts to build MAU value with a base of 10K, and adds random value.
  • multiply random × index: MAU changes asymptotically with each day in the array

Sample Output

[
{ "date": "2025-04-06", "mau": 10000 },
{ "date": "2025-04-05", "mau": 13532 },
...
]

mau-random-chronological

Note: The output here simulates decreasing MAU values week over week, meaning the first entry corresponds to today date with lowest value as @index was 0 This creates a visually backward trend on a chart. We'll correct this in Step 5.

Step 4 – Add Weekend Dips

Now that we have a realistic-looking growth trend, let’s take it one step further by simulating weekly user behavior patterns. It's common for MAUs to dip on weekends and pick up during the weekdays. To reflect that, we’ll vary the multiplier logic based on the day of the week.

We'll use:

  • modulo @index 7 to get the day of the week (cycling every 7 entries)
  • #switch and #case blocks to define different logic for:
    • Sunday (modulo = 0)
    • Saturday (modulo = 6)
    • Weekdays (everything else)

Weekends will show smaller MAU counts, while weekdays will grow as usual.

Updated Response Template

[
{{#repeat 30}}
{
"date": "{{now (object days=(multiply @index -1)) 'iso'}}",
"mau": {{#switch (modulo @index 7)}}
{{#case 0}} {{add 2000 (multiply (faker 'number.int' '500') @index)}}{{/case}} {{!-- Sunday --}}
{{#case 6}} {{add 3000 (multiply (faker 'number.int' '500') @index)}}{{/case}} {{!-- Saturday --}}
{{#default}} {{add 10000 (multiply (faker 'number.int' '500') @index)}}{{/default}} {{!-- Weekdays --}}
{{/switch}}
}
{{/repeat}}
]

📘 What’s New

  • (modulo @index 7): Segments the data into a repeating weekly cycle.
  • #switch with #case: Introduces conditional logic into mock templates. Refer #switch docs.

Sample Output (With Weekend Variation)

[
{ "date": "2025-04-06", "mau": 3500 }, // Sunday , @index=0
{ "date": "2025-04-05", "mau": 6700 }, // Saturday , @index=1
{ "date": "2025-04-04", "mau": 22500 }, // Friday , @index=2
{ "date": "2025-04-04", "mau": 22500 }, // Thursday , @index=
...
]

mau-weekly-dip-random

Step 5 – Chronologically Increasing

At this point, our MAU chart is rich and varied, but there’s one final improvement needed: fixing the chronological order. A shiny dashboard should show increasing monthly-active-users, so the time-series plot flows left to right with increasing order.

The problem here is the @index starts at 0 (today) and increments to 29 (29 days ago), meaning the first object is the latest date. This causes the chart to appear backward (growth appears as decline).

Solution We’ll reverse the multiplier logic using:

(subtract 29 @index): Converts index 0 → 29, 1 → 28, …, 29 → 0

Final Response Template

With this final update, your response template is complete. Add it to your Beeceptor mock rule and test it by sending a few requests.

[
{{#repeat 30}}
{
"date": "{{now (object days=(multiply @index -1)) 'iso'}}",
"mau": {{#switch (modulo @index 7)}}
{{#case 0}} {{add 2000 (multiply (faker 'number.int' '500') (subtract 29 @index))}}{{/case}}
{{#case 6}} {{add 3000 (multiply (faker 'number.int' '500') (subtract 29 @index))}}{{/case}}
{{#default}} {{add 10000 (multiply (faker 'number.int' '500') (subtract 29 @index))}}{{/default}}
{{/switch}}
}{{#unless @last}},{{/unless}}
{{/repeat}}
]

📘 What’s New

  • (subtract 29 @index): Effectively reverses the index.
  • The earliest date (29 days ago) gets the lowest index-driven multiplier
  • Weekend/weekday logic still applies — just in proper time order now

Final Output (Chronologically Ordered)

[
{"date":"2025-04-06T01:25:11.267+05:30","mau":9453},
{"date":"2025-04-05T01:25:11.268+05:30","mau":21648},
{"date":"2025-04-04T01:25:11.269+05:30","mau":18100},
{"date":"2025-04-03T01:25:11.269+05:30","mau":14992},
...
{"date":"2025-03-12T01:25:11.277+05:30","mau":11388},
{"date":"2025-03-11T01:25:11.277+05:30","mau":10411},
{"date":"2025-03-10T01:25:11.277+05:30","mau":3534},
{"date":"2025-03-09T01:25:11.277+05:30","mau":2048},
{"date":"2025-03-08T01:25:11.278+05:30","mau":10000}
]

📊 Final Chart

increasing-mau-final-chart-chronological

This final mock API feeds into your chart and brings it to life with realistic, demo-ready data.

Conclusion

You have eliminated the need for backend scripts or data refresh jobs — still your MAU chart always look up-to-date. This MAU API generates realistic, time-ordered, and behavior-aware analytics with every request. No staging environment. No stale data.

This kind of setup gives your sales team a huge win. They can fire up a dashboard any day and know that the metrics will just work. No last-minute sync with product or engineering. It is a clean, production-like chart that make your dashboard shine during any demo!