Introduction
The Repolyze API provides programmatic access to repository analysis capabilities. All endpoints return JSON responses and support real-time streaming for the analyze endpoint.Base URL
Authentication
The Repolyze API does not require authentication for public repositories. API requests are rate-limited based on client IP address.Rate Limits
Repolyze implements two types of rate limiting:Per-Minute Rate Limit (Burst Protection)
- Limit: 10 requests per minute per IP
- Window: 60 seconds rolling window
- Applies to: All API endpoints
- Response:
429 Too Many RequestswithRetry-After: 60header
Daily Analysis Limits (Tiered)
The/api/analyze endpoint has additional daily limits based on user tier:
| Tier | Daily Limit | Description |
|---|---|---|
| Anonymous | 1 analysis/day | Unauthenticated users (IP-based) |
| Free | 3 analyses/day | Signed-in users |
| Pro | 44 analyses/day | Pro subscription users |
Daily Limit Response
Response Headers
All API responses include rate limit information:Streaming Responses
The/api/analyze endpoint uses Server-Sent Events (SSE) for real-time streaming:
Error Handling
All errors follow a consistent format:Available Endpoints
Analyze Repository
Perform comprehensive AI-powered analysis of a GitHub repository
Get Branches
Retrieve all available branches for a repository
GitHub Info
Get repository metadata and statistics
Authentication & Account
Manage user accounts and check usage limits
Quick Start
cURL Example
JavaScript/TypeScript Example
Python Example
Request Size Limits
- Maximum request body size: 10 KB (10,240 bytes)
- Content-Length header: Checked before parsing
- Response:
413 Payload Too Large
Caching
Repolyze implements multiple layers of caching for optimal performance:Analysis Result Cache
- Duration: In-memory cache for recently analyzed repositories
- Key:
{owner}/{repo}:{branch} - Behavior: Instant response for cached results (no AI call)
GitHub Data Cache
- Metadata: Server-side cached
- Branches: 5 minutes (300 seconds) with stale-while-revalidate
- Repository tree: Cached per branch
In-Flight Request Deduplication
If the same repository is being analyzed by multiple requests simultaneously, subsequent requests wait for the first analysis to complete and receive the cached result.Status Codes
| Code | Status | Description |
|---|---|---|
200 | OK | Request successful |
400 | Bad Request | Invalid request parameters |
404 | Not Found | Repository or branch not found |
413 | Payload Too Large | Request body exceeds 10 KB |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Server error during analysis |
503 | Service Unavailable | Server not properly configured |
Health Check
You can check the API health status:Best Practices
Handle Rate Limits Gracefully
Handle Rate Limits Gracefully
Always check the
X-RateLimit-Remaining header and implement exponential backoff when you receive 429 responses.Process Streaming Events
Process Streaming Events
The analyze endpoint streams multiple event types. Handle each type appropriately:
metadata: Initial repository informationscores: Quality scores and metricscontent: AI-generated analysis textautomations: Suggested improvementsrefactors: Refactoring suggestionstier: User tier informationdone: Analysis completeerror: Error occurred
Validate GitHub URLs
Validate GitHub URLs
Always validate GitHub URLs before sending requests:
Use Branch Parameter Efficiently
Use Branch Parameter Efficiently
If you need to analyze a specific branch, fetch available branches first to ensure it exists:
Need Help?
If you encounter issues or have questions:- Check the Error Responses reference
- Review the Analysis Response types
- Open an issue on GitHub