Skip to content

CG821/romonitor-fetch

Repository files navigation

RoMonitor CCU Data Fetcher

A simple, focused tool for fetching Roblox concurrent user (CCU) data from the RoMonitor API and exporting to CSV format.

Purpose

This tool connects to the RoMonitor API to retrieve half-hourly concurrent user counts, aggregates them to daily averages, and exports the data to CSV files for analysis.

Features

  • Simple API: Clean, minimal command-line interface
  • Flexible: Fetch all history, specific quarters, or just the latest quarter
  • Reliable: Error handling and retry logic
  • Efficient: Aggregates half-hourly data to daily averages
  • Output: Daily CCU data + quarterly summary

Installation

pip install -r requirements.txt

Usage

Fetch all historical data (2020-present)

python fetch_ccu_data.py

Fetch only the latest quarter

python fetch_ccu_data.py --update

Fetch a specific quarter

python fetch_ccu_data.py --quarter Q4 2025

Fetch to custom output directory

python fetch_ccu_data.py --output-dir /path/to/output

Output

The script creates two CSV files in the data/ directory:

ccu_daily.csv

Daily aggregated CCU data

  • Date: Calendar date
  • Avg_CCU: Average concurrent users for the day
  • Max_CCU: Peak concurrent users for the day
  • Min_CCU: Minimum concurrent users for the day
  • Quarter: Quarter label (e.g., "Q3 2025")

ccu_quarterly_summary.csv

Quarterly aggregated statistics

  • Quarter: Quarter label
  • Avg_CCU: Average CCU for the quarter
  • Max_CCU: Peak CCU in the quarter
  • Date (min, max, count): Date range and number of days

Data Source

API Endpoint: https://api.romonitorstats.com/count

Parameters:

  • start: Start date (YYYY-MM-DD)
  • end: End date (YYYY-MM-DD)

Response Format:

[
  {
    "time": "2025-10-29T00:00:00Z",
    "count": 12571336
  },
  ...
]

Historical Quarters Supported

The script can fetch data from:

  • Q1 2020 through Q4 2025
  • Full 6 years of history
  • Easily extendable for future quarters

Examples

Weekly update to latest data

# Run this every Monday to get the latest complete week
python fetch_ccu_data.py --update

Monthly consolidation

# Run this on the 1st of each month to fetch full data
python fetch_ccu_data.py

Analysis integration

import pandas as pd

# Load the daily CCU data
ccu = pd.read_csv('data/ccu_daily.csv')

# Convert date to datetime
ccu['Date'] = pd.to_datetime(ccu['Date'])

# Calculate YoY growth for October
oct_2024 = ccu[(ccu['Date'].dt.year == 2024) & (ccu['Date'].dt.month == 10)]
oct_2025 = ccu[(ccu['Date'].dt.year == 2025) & (ccu['Date'].dt.month == 10)]

growth = (oct_2025['Avg_CCU'].mean() - oct_2024['Avg_CCU'].mean()) / oct_2024['Avg_CCU'].mean() * 100
print(f"October YoY Growth: {growth:.1f}%")

Configuration

Edit the top of fetch_ccu_data.py to modify:

  • API_BASE_URL: API endpoint (if changed)
  • OUTPUT_DIR: Default output directory
  • TIMEOUT: API request timeout (seconds)
  • RETRY_DELAY: Delay between API calls (seconds)
  • QUARTERS: List of quarters to fetch (add future quarters as needed)

Error Handling

The script handles:

  • ✓ Network timeouts
  • ✓ API errors (HTTP status codes)
  • ✓ Empty responses
  • ✓ Malformed data

Failed quarters are skipped with a warning; successful quarters are saved.

Performance

  • Time per quarter: ~1-2 seconds (includes API delay)
  • Full history fetch: ~30-40 seconds for all 24 quarters
  • Update fetch: ~1-2 seconds for a single quarter

Maintenance

Adding new quarters

Update the QUARTERS list in the script:

QUARTERS = [
    ...existing quarters...
    ('Q1 2026', '2026-01-01', '2026-03-31'),
    ('Q2 2026', '2026-04-01', '2026-06-30'),
]

Integration with analysis

The output CSV files can be directly used with:

  • Pandas DataFrames for analysis
  • Excel for manual review
  • Database for permanent storage
  • Other analysis scripts

Troubleshooting

"ERROR: HTTP 403"

The API may be blocking requests. Wait a few moments and try again.

"ERROR: HTTP 404"

The date range may not exist or the API endpoint has changed.

"ERROR: No data returned"

The specified quarter may not have data yet (e.g., future quarters before they occur).

Timeout errors

Increase the TIMEOUT variable in the script if API is slow.

License

Internal use only - Moffett Nathanson

Version History

  • v1.0 (Oct 30, 2025): Initial release
    • Fetch quarters by quarter
    • Simple CLI with argparse
    • Daily + quarterly aggregation

About

Simple Python tool for fetching Roblox concurrent user (CCU) data from RoMonitor API and exporting to CSV

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages