Overview
Repolyze implements daily rate limits to ensure fair usage and system stability. Limits vary by account tier and reset every day at midnight UTC.Rate limits apply to repository analysis requests only. Viewing existing analyses, sharing links, and browsing the dashboard do not count against your quota.
Rate Limit Tiers
Repolyze enforces different limits based on your authentication status and plan:Anonymous Users
- Limit: 1 analysis per day
- Tracking: By IP address
- Reset: Midnight UTC
- Scope: One unique repository per day per IP
Free Users
- Limit: 3 analyses per day
- Tracking: By user ID
- Reset: Midnight UTC
- Scope: Any repositories (repeats allowed)
Free accounts are authenticated via GitHub or Google OAuth. Sign in to increase your daily limit from 1 to 3 analyses.
Pro Users
- Limit: 44 analyses per day
- Tracking: By user ID
- Reset: Midnight UTC
- Scope: Any repositories (repeats allowed)
The Pro tier offers 14x more analyses than the Free tier, plus access to AI Insights and Data Flow diagrams.
How Rate Limiting Works
Implementation Details
Repolyze uses a PostgreSQL-backed rate limiting system for accuracy and persistence:- Request Received: User submits a repository for analysis
- Authentication Check: System determines user tier (anonymous, free, or pro)
- Usage Lookup: Queries the
AnalysisRequesttable for today’s usage - Limit Enforcement: Compares current usage against tier limit
- Recording: Successful requests are logged with IP, user ID, and timestamp
Database Schema
All analysis requests are tracked in theAnalysisRequest table:
prisma/schema.prisma
Records older than 2 days are automatically cleaned up to keep the database lean. See
lib/analysis-rate-limit.ts:92 for cleanup logic.Rate Limit Headers
Every analysis API response includes rate limit information:| Header | Description |
|---|---|
X-RateLimit-Limit | Total daily quota for your tier |
X-RateLimit-Remaining | Number of analyses left today |
X-RateLimit-Reset | Unix timestamp when quota resets (midnight UTC) |
Handling Rate Limits
Client-Side Behavior
When you hit your daily limit, the API returns:Best Practices
- Check Headers: Always inspect
X-RateLimit-Remainingbefore making requests - Cache Results: Store analysis results locally to avoid re-analyzing the same repository
- Upgrade Tier: Consider Pro if you frequently hit Free tier limits
- Batch Work: Plan your analyses to stay within daily quotas
Frequently Asked Questions
Why does my limit reset at midnight UTC?
Why does my limit reset at midnight UTC?
All rate limits use UTC time to ensure consistency across timezones. Your quota resets at
00:00:00 UTC every day, regardless of your local timezone.Can I analyze the same repository multiple times?
Can I analyze the same repository multiple times?
Yes, authenticated users (Free and Pro) can re-analyze repositories. Each analysis counts toward your daily quota. Anonymous users are limited to 1 unique repository per day per IP.
What happens if I upgrade mid-day?
What happens if I upgrade mid-day?
Your limit increases immediately. If you’ve used 3/3 Free analyses and upgrade to Pro, you’ll have 44 total for the day (41 remaining).
Do failed analyses count against my limit?
Do failed analyses count against my limit?
No, only successful analyses are recorded. If the analysis fails due to a server error or invalid repository, it does not consume your quota.
Can I request a higher limit?
Can I request a higher limit?
The Pro tier (44/day) is our highest standard limit. For enterprise needs, contact support at [email protected].
Technical Reference
Source Code
| File | Description |
|---|---|
lib/analysis-rate-limit.ts | Core rate limiting logic |
lib/tiers.ts | Tier configuration and feature gates |
app/api/analyze/rate-limit.ts | Legacy rate limit (deprecated) |
prisma/schema.prisma | Database schema for tracking |
Key Functions
checkAnalysisRateLimit(request, ip): Main rate limit check (lib/analysis-rate-limit.ts:20)recordAnalysisRequest(ip, repoUrl, userId): Log successful analysis (lib/analysis-rate-limit.ts:78)getTierLimits(tier): Get limits for a specific tier (lib/tiers.ts:64)
Next Steps
Plans & Pricing
Compare tier features and pricing
Authentication
Sign in to increase your daily limit