API Reference
Integrate GitHub analytics into your workflows with the GitScope REST API.
Authentication
GitScope supports two authentication methods:
/api/v1/ endpoints (Developer plan+)Public Endpoints
These endpoints are available to all users, including guests (limited by rate limits):
/api/github/proxy?path={github_api_path}Proxy requests to GitHub API with optional user token. Rate limited.
/api/github/rate-limitCheck current GitHub API rate limit status
/api/github/trendingGet trending repositories by language and time window
/api/github/searchSearch GitHub repositories and users
/api/csrfGet a fresh CSRF token for state-changing requests
Authenticated Endpoints
These endpoints require a valid session (GitHub OAuth or email/password):
/api/user/settingsGet user profile, connected providers, AI tier, and recent jobs
/api/user/historyGet user's repository search history
/api/user/historyAdd a repository to search history
/api/user/notificationsGet user's in-app notifications
/api/user/accountUpdate password or GitHub PAT
/api/user/ai-capabilitiesGet AI features available for user's tier
AI Endpoints
These endpoints require authentication. AI endpoints are gated by plan tier.
/api/ai/repo-scanFull AI-powered repo health scan — returns 0–100 health score, findings, and recommendations
/api/ai/osv-scanScan a repository against the Google OSV CVE database — returns vulnerabilities with severity and CVSS scores
/api/ai/generate-pr-descriptionGenerate an AI pull request description from diff context with configurable tone
/api/ai/generate-readmeAI-generated README from repository structure and source files
/api/ai/generate-changelogGenerate a changelog from recent commits (keepachangelog | conventional | narrative format)
GitHub Data Endpoints
Server-side GitHub proxies. All requests use your stored OAuth token automatically — works for private repos.
/api/github/contributors?repo={owner/repo}Contributor stats for a repository — commit count, additions, deletions per contributor. Returns 202 if GitHub is still computing stats (retry after 3–5 s).
/api/github/ci-runs?repo={owner/repo}Most recent 50 GitHub Actions workflow runs for a repository, grouped by workflow name.
/api/github/coverage?repo={owner/repo}Test coverage percentage from Codecov API, detected test frameworks, and config files found in the repository.
/api/github/coverage/pr?repo={owner/repo}&pr={number}PR-level coverage diff — base vs head coverage, delta, status (improved/degraded/unchanged), and per-file breakdown with test file detection. Pulls from Codecov PR comparison API.
/api/github/open-prs?repo={owner/repo}Open pull requests for a repository — title, author, head/base branch, additions, deletions, labels, and PR URL.
/api/ai/team-scans?org={org-name}Aggregated scan history for all repositories in an organization, across all GitScope users. Returns per-repo latest health score, critical count, and scanner identity.
Public REST API (v1)
Machine-readable endpoints for CI pipelines and third-party integrations. Authenticate with an API key — generate one in Settings → API Keys. Pass the key as Authorization: Bearer sk_gs_... or X-API-Key. Rate limit: 120 req/min per key. Available on Developer plan and above.
/api/v1API discovery — returns available endpoints, scopes, and authentication instructions.
/api/v1/repos/{owner}/{repo}/scanLatest scan result for a repository — healthScore, securityScore, qualityScore, criticalCount, summary, and timestamp. Scope: scans:read.
/api/v1/repos/{owner}/{repo}/doraDORA metrics for a repository — leadTime, deployFreq, cfr, mttr, deploySource (github-deployments | actions-workflows | pr-merges). Scope: dora:read.
Public Badge API
Embeddable SVG badge — no authentication required:
/api/badge?repo={owner/repo}Returns a live SVG health-score badge for any repo. Embed in any README.
GitHub OAuth Required
These endpoints require GitHub OAuth sign-in specifically:
/api/user/code-impact?repo={owner/repo}Get code impact analysis for a repository
/api/user/pr-risk?repo={owner/repo}Get PR risk analysis and scoring
/api/user/dora-metrics?repo={owner/repo}Get DORA metrics (deployment frequency, lead time, etc.)
/api/user/dependency-map?repo={owner/repo}Get dependency analysis and security advisories
Rate Limits
Rate limits are per IP for guests, per token for authenticated users.
Security
- ✓HTTPS required for all requests
- ✓CSRF tokens for state-changing operations
- ✓Secure, httpOnly, SameSite=Strict cookies
- ✓IP-based rate limiting with abuse detection
Coming Soon
Official SDKs are planned for future release. For now, use the REST API directly.