Skip to main content
Hero Light

The heart of market ingestion

Hridaya (हृदय) is a professional-grade asynchronous data engine engineered to overcome the unique challenges of the Steam Community Market. Unlike standard scrapers, Hridaya acts as a central nervous system for market data, strategically timing every pulse of the exchange to maintain a high-fidelity record of market width and depth.

What makes Hridaya different

Strategic ingestion

Intelligent scheduling that balances real-time order-book snapshots with massive historical data fetches

Resource sovereignty

A global orchestrator managing a shared sliding-window rate-limit budget across concurrent asynchronous tasks

Financial grade integrity

Automated data sanitization translating regional currency symbols and non-standard timestamps into structured numeric data

Steam API compliance

Respects Steam’s strict 15 requests per minute rate limit through sophisticated rate-limiting algorithms

Key features

Four Steam Market API endpoints

Hridaya supports all major Steam Market data endpoints:
Fetches the latest lowest price, median price, and sales volume for any Steam item.
await client.fetch_price_overview(
    appid=730,  # CS2
    market_hash_name="Revolution Case",
    currency=1,  # USD
    country="US"
)
Captures the full buy/sell order book with price levels and quantities.
await client.fetch_orders_histogram(
    appid=730,
    item_nameid=176042118,
    currency=1,
    country="US"
)
Retrieves real-time trade execution data including purchase timestamps and prices.
await client.fetch_orders_activity(
    item_nameid=176042118,
    currency=1,
    country="US"
)
Fetches complete historical price charts (requires Steam session cookies).
await client.fetch_price_history(
    appid=730,
    market_hash_name="AWP | Neo-Noir (Factory New)",
    currency=3  # EUR
)

Dual-database architecture

Hridaya intelligently routes data to the right storage backend based on data characteristics.
SQLite - High-frequency operational snapshots
  • Price overview data
  • Order book histograms
  • Trade activity logs
  • Optimized with WAL mode and memory-mapped I/O
TimescaleDB (optional) - Long-term historical time-series
  • Price history data with automatic compression
  • Hypertable partitioning for efficient queries
  • Automatic data retention policies

Intelligent scheduling

Two specialized schedulers handle different data collection patterns:
# Urgency-based priority scheduling
# Calculates when each item is "most urgent" to poll
# Ideal for: priceoverview, itemordershistogram, itemordersactivity

live_items = [
    {
        "market_hash_name": "Revolution Case",
        "apiid": "itemordersactivity",
        "polling-interval-in-seconds": 8
    }
]

scheduler = snoozerScheduler(
    live_items=live_items,
    rate_limiter=shared_rate_limiter
)

Rate limiting that works

Steam enforces a strict global limit of 15 requests per 60 seconds. Exceeding this results in temporary IP bans.
Hridaya uses a sliding-window log algorithm to ensure compliance:
class RateLimiter:
    """Sliding Window Log algorithm for Steam API safety."""
    
    def __init__(self, max_requests: int = 15, window_seconds: float = 60.0):
        self._lock = asyncio.Lock()
        self._timestamps: list[float] = []
        self._max_requests = max_requests
        self._window_seconds = window_seconds

    async def acquire_token(self) -> None:
        """Wait if necessary to respect rate limits."""
        async with self._lock:
            current_time = time.time()
            cutoff_time = current_time - self._window_seconds
            self._timestamps = [ts for ts in self._timestamps if ts > cutoff_time]
            
            if len(self._timestamps) >= self._max_requests:
                # Calculate exact wait time
                oldest_timestamp = self._timestamps[0]
                wait_time = self._window_seconds - (current_time - oldest_timestamp)
                await asyncio.sleep(wait_time)
            
            self._timestamps.append(time.time())

System architecture

Hridaya follows a clean separation of concerns:
cerebro.py (Orchestrator)         # The brain - entry point and lifecycle manager
├── RateLimiter                    # Shared rate limiting across all schedulers
├── snoozerScheduler               # Real-time urgency-based scheduling
├── clockworkScheduler             # Time-synchronized batch scheduling
└── SteamAPIClient                 # HTTP client for Steam Market API
    ├── dataClasses                # Pydantic models for type safety
    └── SQLinserts                 # Database routing and persistence
        ├── SQLite                 # Operational snapshots
        └── TimescaleDB (optional) # Historical time-series

Use cases

Market analysis

Build real-time pricing dashboards and historical trend analysis for CS2 skins, cases, and stickers

Trading bots

Power algorithmic trading strategies with sub-minute market data refresh rates

Price tracking

Set up alerts for price movements, order book depth changes, or trading volume spikes

Market research

Analyze market microstructure, spread dynamics, and liquidity patterns

Next steps

Quickstart

Get Hridaya running in under 5 minutes

Installation

Detailed installation and configuration guide

Build docs developers (and LLMs) love