API Reference
Integrate GitHub analytics into your workflows with the GitScope REST API.
Authentication
All API requests must include a valid session cookie from NextAuth.js. The API uses the same authentication as the web interface — there are no separate API tokens. All requests must be made over HTTPS.
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
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
/api/ai/analyzeAI-powered repository analysis via Claude
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.