API Usage & System Design
The portfolio centerpiece: cost-aware architecture for a 100,000 request/year Blockchair budget.
274 req/day target
Today
2.9% utilization
YTD used
14.8% utilization
Projected
86.1% utilization
Cache hit
94.1% utilization
Request Flow
browser has no Blockchair keyBrowser
Submits intentional searches and reads internal JSON routes.
Next.js API
Route handlers validate input, rate-limit, and choose TTLs.
Cache
In-memory starter cache plus Next revalidation headers.
Blockchair
Called server-side only, with key from environment variables.
Cache and Refresh Schedule
| Data type | Refresh | Reason |
|---|---|---|
| Dashboard overview | 15-60 min | High recruiter visibility, low volatility |
| Chain stats | 30-60 min | Balances freshness with daily request ceiling |
| Historical charts | 12-24 h | Expensive and rarely needs minute freshness |
| Latest blocks / txs | 5-15 min | Short TTL, still cache-first |
| Transaction or block search | 30-365 d | Immutable once confirmed |
| Address summaries | 15-60 min | Mutable, so shorter TTL |
| Invalid searches | 5-15 min | Avoids repeated waste from bad input |
Endpoint Cost
| Endpoint | Hit | TTL |
|---|---|---|
| /api/dashboard | 94% | 30m |
| /api/chains/[chain] | 92% | 45m |
| /api/search?kind=block | 98% | 180d |
| /api/search?kind=transaction | 98% | 180d |
| /api/search?kind=address | 82% | 30m |