API Reference
Introduction
The Repo Cat REST API allows you to programmatically analyze GitHub repositories, manage scans, and retrieve results. This is the traditional REST API — for AI tool integration, see the MCP Server documentation.
The API uses standard HTTP methods (GET, POST, DELETE) and returns JSON responses.
Authentication
Most API endpoints require authentication using an API key. Basic scans can be performed without an API key, but Standard and Deep scans require authentication.
Authentication Methods
- Header:
X-API-Key: <your-api-key> - Query Parameter:
?apiKey=<your-api-key>
Rate Limiting
API keys are subject to rate limiting based on your subscription tier. See the Rate Limiting section for details.
Base Endpoint
All API requests are made to the following base URL:
http://repo-cat.futoro.co.uk
API Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/scan | Trigger a new scan |
| GET | /api/v1/scan/:id | Get scan details |
| GET | /api/v1/scan/:id/pdf | Download PDF report |
| POST | /api/v1/scan/:id/cancel | Cancel a scan |
| DELETE | /api/v1/scan/:id | Delete a scan |
| GET | /api/v1/scans | List all scans |
| GET | /api/v1/scans/sse | Real-time progress (SSE) |
| GET/PUT | /api/v1/settings | Get/update user settings |
Scan Endpoint
Analyze a GitHub repository and get metadata and heuristics.
http://repo-cat.futoro.co.uk/api/v1/scanQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| repo | string | Yes | GitHub repository in format "owner/repo" |
| level | string | Yes | Scan level: "basic", "standard", or "deep" |
| apiKey | string | No* | Your API key. Required for standard and deep scans. |
Headers
| Header | Required | Description |
|---|---|---|
| X-API-Key | No* | Alternative way to pass API key |
Response Format
Success Response (200)
{
"success": true,
"data": {
"level": "basic" | "standard" | "deep",
"repo": "owner/repo",
"scannedAt": "2026-03-29T12:00:00.000Z",
"metadata": { ... },
"heuristics": { ... },
"codeQuality": { ... }, // standard/deep only
"security": { ... }, // standard/deep only
"contributorStats": { ... }, // standard/deep only
"aiAnalysis": { ... } // deep only
}
}Basic Level Response
{
"success": true,
"data": {
"level": "basic",
"repo": "owner/repo",
"scannedAt": "2026-03-29T12:00:00.000Z",
"metadata": {
"name": "string",
"description": "string | null",
"stars": number,
"forks": number,
"watchers": number,
"language": "string | null",
"license": "string | null",
"topics": string[],
"defaultBranch": "string",
"size": number,
"openIssues": number,
"contributorsCount": number,
"createdAt": "string",
"pushedAt": "string | null",
"lastCommitDate": "string | null"
},
"heuristics": {
"commitDensity": {
"score": number,
"commitsPerMonth": number,
"description": "string"
},
"packageBloat": {
"score": number,
"dependencyCount": number,
"devDependencyRatio": number,
"description": "string"
}
}
}
}Standard Level Response
{
"success": true,
"data": {
"level": "standard",
"repo": "owner/repo",
"scannedAt": "2026-03-29T12:00:00.000Z",
"metadata": { ... },
"heuristics": { ... },
"codeQuality": {
"score": number,
"testCoverage": number,
"lintingIssues": number,
"testFilesRatio": number
},
"security": {
"score": number,
"vulnerabilities": number,
"outdatedDependencies": string[],
"securityAdvisories": string[]
},
"contributorStats": {
"activeContributors": number,
"avgResponseTime": number,
"prMergeRate": number,
"topContributors": string[]
}
}
}Deep Level Response
{
"success": true,
"data": {
"level": "deep",
"repo": "owner/repo",
"scannedAt": "2026-03-29T12:00:00.000Z",
"metadata": { ... },
"heuristics": { ... },
"codeQuality": { ... },
"security": { ... },
"contributorStats": { ... },
"aiAnalysis": {
"score": number,
"architectureScore": number,
"maintainabilityScore": number,
"recommendations": [
{
"type": "performance" | "security" | "maintainability",
"priority": "high" | "medium" | "low",
"title": "string",
"description": "string",
"file": "string",
"line": number
}
],
"summary": "string"
}
}
}Error Response (4xx/5xx)
{
"success": false,
"error": "Error message describing what went wrong"
}Scan Levels
Basic
Provides fundamental repository information including metadata and basic heuristics. Does not require an API key.
- Repository metadata (stars, forks, description, etc.)
- Commit density analysis
- Package bloat detection
Standard
Enhanced analysis with static code quality assessment. Requires an API key.
- Everything in Basic
- Static code analysis
- Security issue detection
- Best practices recommendations
Deep
Comprehensive analysis with detailed recommendations. Requires an API key.
- Everything in Standard
- AI-powered code analysis
- Architecture recommendations
- Performance optimization suggestions
Get Scan by ID
Retrieve the details of a specific scan by its ID.
http://repo-cat.futoro.co.uk/api/v1/scan/:idPath Parameters
| Parameter | Description |
|---|---|
| id | The scan ID (integer) |
Response
{
"success": true,
"scan": {
"id": 123,
"repo": "owner/repo",
"level": "deep",
"status": "completed",
"result": { ... },
"createdAt": "2026-03-29T12:00:00.000Z"
}
}Download Scan PDF
Download a scan result as a PDF document.
http://repo-cat.futoro.co.uk/api/v1/scan/:id/pdfPath Parameters
| Parameter | Description |
|---|---|
| id | The scan ID (integer) |
Response
Returns PDF binary with Content-Type: application/pdf headers.
Cancel Scan
Cancel a running scan. Only works on scans with status "processing".
http://repo-cat.futoro.co.uk/api/v1/scan/:id/cancelPath Parameters
| Parameter | Description |
|---|---|
| id | The scan ID (integer) |
Response
{ "success": true }Delete Scan
Delete a scan and its associated results.
http://repo-cat.futoro.co.uk/api/v1/scan/:idPath Parameters
| Parameter | Description |
|---|---|
| id | The scan ID (integer) |
Response
{ "success": true }List Scans
Get a paginated list of your scans.
http://repo-cat.futoro.co.uk/api/v1/scansQuery Parameters
| Parameter | Type | Description |
|---|---|---|
| page | number | Page number (default: 1) |
| status | string | Filter by status: pending, processing, completed, failed, cancelled |
| level | string | Filter by level: basic, standard, deep |
Response
{
"success": true,
"scans": [
{
"id": 123,
"repo": "owner/repo",
"level": "deep",
"status": "completed",
"createdAt": "2026-03-29T12:00:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 50,
"totalPages": 3
}
}Scan Progress (SSE)
Connect to real-time scan progress updates using Server-Sent Events.
http://repo-cat.futoro.co.uk/api/v1/scans/sseResponse
Returns an event stream with the following event types:
scan- Scan status changeprogress- Scan progress updatecomplete- Scan completederror- Scan error
Example Event
event: scan
data: {"id":123,"status":"processing","progress":50,"stage":"analyzing-code"}
event: complete
data: {"id":123,"status":"completed","result":{...}}User Settings
Get and update user settings including notifications and webhooks.
Get Settings
http://repo-cat.futoro.co.uk/api/v1/settingsResponse
{
"success": true,
"settings": {
"defaultLevel": "standard",
"notifications": true,
"email": "user@example.com",
"webhook_url": "https://your-app.com/webhook",
"webhook_enabled": true,
"webhook_on_scan_started": false,
"webhook_on_scan_completed": true,
"webhook_on_scan_failed": false,
"webhook_on_scan_cancelled": false
}
}Update Settings
http://repo-cat.futoro.co.uk/api/v1/settingsRequest Body
| Field | Type | Description |
|---|---|---|
| defaultLevel | string | Default scan level: "basic", "standard", or "deep" |
| notifications | boolean | Enable email notifications |
| webhook_url | string | Your webhook endpoint URL |
| webhook_enabled | boolean | Enable webhooks |
| webhook_on_scan_started | boolean | Send webhook when scan starts |
| webhook_on_scan_completed | boolean | Send webhook when scan completes (default: true) |
| webhook_on_scan_failed | boolean | Send webhook when scan fails |
| webhook_on_scan_cancelled | boolean | Send webhook when scan is cancelled |
Example Request
{
"defaultLevel": "deep",
"webhook_url": "https://your-app.com/webhook",
"webhook_enabled": true,
"webhook_on_scan_completed": true,
"webhook_on_scan_failed": true
}Response
{
"success": true,
"settings": {
"defaultLevel": "deep",
"notifications": true,
"email": "user@example.com",
"webhook_url": "https://your-app.com/webhook",
"webhook_enabled": true,
"webhook_on_scan_started": false,
"webhook_on_scan_completed": true,
"webhook_on_scan_failed": true,
"webhook_on_scan_cancelled": false
}
}Code Examples
JavaScript/TypeScript
async function scanRepo(repo, level, apiKey) {
const params = new URLSearchParams({
repo,
level,
...(apiKey && { apiKey }),
});
const response = await fetch(`/api/v1/scan?${params}`);
return response.json();
}
// Usage
const result = await scanRepo(facebook/react, 'basic');
console.log(result.data.metadata.stars);Python
import requests
def scan_repo(repo, level, api_key=None):
params = {
'repo': repo,
'level': level,
}
headers = {}
if api_key:
headers['X-API-Key'] = api_key
response = requests.get('http://repo-cat.futoro.co.uk/api/v1/scan',
params=params,
headers=headers)
return response.json()
# Usage
result = scan_repo(facebook/react, 'basic')
print(result['data']['metadata']['stars'])